1 生成公钥和私钥
1 ssh-keygen -t rsa -C '邮箱地址'
2 输入秘钥公钥文件名
3 输入gitee登录密码
4 cat 秘钥文件,复制粘贴到gitee,添加公钥
5 ssh -T git@gitee.com
2 上传完公钥提交依旧失败
在gitee上传完公钥依旧提示git@gitee.com: Permission denied (publickey).
那么问题在于你可能配置多个秘钥,如github,公司的gitlab,codechina等
在c/Users/rainy/.ssh下新增config(有则无需新增)
Host ip也可
port 8000
PreferredAuthentications publickey
User username
IdentityFile ~/.ssh/id_company
Host github.com
HostName github.com
PreferredAuthentications publickey
User username
IdentityFile ~/.ssh/id_git
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
User username
IdentityFile ~/.ssh/gitee