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

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

ssh -T [email protected]
[email protected]'s password: 
Permission denied, please try again.
[email protected]'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 [email protected]
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

猜你喜欢

转载自blog.csdn.net/li4692625/article/details/120307465