$ ssh-keygen -t rsa -C "xxxxxxx@qq.com" -f "github_id_rsa" $ ssh-keygen -t rsa -C "xxxxxxx@qq.com" -f "gitee_id_rsa"
完成后,.ssh文件夹生成以下文件
执行命令cat github_id_rsa.pub
把第二行到结尾的内容复制到github的ssh中保存
同样的操作,添加gitee的ssh
在.ssh文件夹下执行命令vi config
文件中添加以下内容
# gitee Host gitee.com HostName gitee.com PreferredAuthentications publickey IdentityFile ~/.ssh/gitee_id_rsa # github Host github.com HostName github.com PreferredAuthentications publickey IdentityFile ~/.ssh/github_id_rsa
执行
ssh -T git@gitee.com
成功则返回
Welcome to Gitee.com ,yourname!
执行
ssh -T git@github.com
成功则返回
Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
宠物免费领养小程序,欢迎来踩