github、gitlab 管理多个ssh key

 第一种方法: 通过 git 命令行来操作

  1、cd ~/.ssh 

  2、ls 

注:如果.ssh 目录下有文件存在那么表示之前添加过

  3、 ssh-keygen -t rsa -C "xxxxxx@yy.com"  # git 的账户邮箱

  Enter file in which to save the key (/c/Users/xxxx_000/.ssh/id_rsa):   # 输入文件的名称,推荐直接回车

  Enter passphrase (empty for no passphrase):   # 如果这里填写了密码,就不能实现免密码登录了,推荐不填写

  Enter same passphrase again:   # 再次确认密码(可以为空)

  Your identification has been saved in /c/Users/xxxx_000/.ssh/id_rsa.   #生成的密钥

  Your public key has been saved in /c/Users/xxxx_000/.ssh/id_rsa.pub.  #生成的公钥

  4、复制id_rsa.pub的公钥内容到 git 服务器上

  

posted @ 2016-04-25 18:29  想飞的枫叶  阅读(244)  评论(0编辑  收藏  举报