引用:
核心:
准备:
生成session key
ssh-keygen -t rsa -f ~/.ssh/id_rsa.gitee -C "xxxxxx@qq.com"
ssh-keygen -t rsa -f ~/.ssh/id_rsa.github -C "xxxxxx@qq.com"
配置:
在.ssh文件夹中添加配置config
# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa.gitee
# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa.github
校验:
ssh -T git@gitee.com
ssh -T git@github.com