解决Github拒绝授权问题Permission denied, please try again

正确生成秘钥并在Github添加公钥后通过以下命令测试SSH

ssh -T git@github.com
git@github.com's password: 
Permission denied, please try again.
git@github.com's password: 

输入密码无效;

解决办法:

vim ~/.ssh/config
#添加
Host github.com
identityFile ~/.ssh/id_rsa#自己的私钥文件名
Host github.com
Hostname ssh.github.com
Port 443
User git

再次测试:

ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '[18.141.90.153]:443' to the list of known hosts.
Hi xxxxx! You've successfully authenticated, but GitHub does not provide shell access.

来源:Using SSH over the HTTPS port - GitHub Docs

上一篇:Java之使用分治算法解决斐波那契数列问题(Fibonacci Again)


下一篇:ACboy needs your help again!(栈和队列)HDU - 1702