其他分享
首页 > 其他分享> > Git配置多个SSH Key

Git配置多个SSH Key

作者:互联网

 

查看已经生成的SSH Key:

cat ~/.ssh/id_rsa.pub

 

生成一个新的ssh key:

ssh-keygen -t rsa -C 'xxx@dingtalk.com' -f ~/.ssh/codeup_id_rsa

 

 同样可以查看新生成的ssh key:

cat ~/.ssh/codeup_id_rsa.pub

 

新建配置config:

touch ~/.ssh/config
# codeup.aliyun.com
Host codeup.aliyun.com
HostName codeup.aliyun.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/codeup_id_rsa

# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

 

测试验证:

ssh -T git@gitee.com
ssh -T git@codeup.aliyun.com

 

标签:Git,Key,aliyun,rsa,SSH,codeup,com,id,ssh
来源: https://www.cnblogs.com/ooo0/p/15554890.html