ssh-keygen -t rsa -C 'email_1@email.com'
然后一路enter就好了
首先
ssh-keygen -t rsa -C 'email_2@email.com' //同一个邮箱也可以
然后指定公钥的时候,自己命名:例如 /c/Users/Administrator/.ssh/id_rsa_2 (默认名字是id_rsa,假设已经被git用了)
然后一路enter就好了
如果是bitbucket
#建一个bitbucket别名,新建的帐号使用这个别名做克隆和更新
Host my_bitbucket
HostName bitbucket.org
User git
IdentityFile ~/.ssh/id_rsa_2.pub
如果是git
#建一个github别名,新建的帐号使用这个别名做克隆和更新
Host my_github
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_2.pub
ssh-add C:/Users/Administrator/.ssh/id_rsa_2
如果出现提示:Could not open a connection to your authentication agent.
则先:
eval `ssh-agent`
ssh-add C:/Users/Administrator/.ssh/id_rsa_2
// 假如原始命令是
git clone git@bitbucket.org:somthing/mail.git
//那么你应该用如下命令
git clone my_github:somthing/mail.git
一台电脑同时添加git和bitbucket两个网站的ssh key
原文:https://www.cnblogs.com/qq917937712/p/11326142.html