码迷,mamicode.com
首页 > 其他好文 > 详细

生成多个git ssh密钥

时间:2015-04-21 20:01:52      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:

如果你已经有了一套名为 id_rsa 的公秘钥,将要生成另外一个公钥,比如 aysee ,你也可以使用任何你喜欢的名字。

步骤如下:

 

1、生成一个新的自定义名称的公钥:

ssh-keygen -t rsa -C "YOUR_EMAIL@YOUREMAIL.COM" -f ~/.ssh/aysee

  执行命令后,生成命名的公钥和生成默认公钥的步骤一样。

执行完成后,会在 ~/.ssh/目录下生成一个 aysee 和 aysee.pub 文件。

2、在 SSH 用户配置文件 ~/.ssh/config 中指定对应服务所使用的公秘钥名称,如果没有 config 文件的话就新建一个,并输入以下内容:

Host github.com www.github.com
  IdentityFile ~/.ssh/aysee

3、添加 aysee.pub 到你的git服务器网站上。

4、测试配置文件是否正常工作

ssh -T git@gitcafe.com

  如果,正常的话,会出现如下提示:

Hi USERNAME! You‘ve successfully authenticated, but github does not provide shell access.

  

 

生成多个git ssh密钥

标签:

原文地址:http://www.cnblogs.com/ayseeing/p/4445194.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!