Github提示Permission denied (publickey)

通过ssh -T git@github.com登录Github时,系统默认使用id_rsa密钥文件。而如果你在新建秘钥的时候使用了自定义的名称,比如github_rsa,则需要再配置一个config文件。

cd ~/.ssh/

vim config
Host github.com
 HostName github.com
 User git
 IdentityFile ~/.ssh/github_rsa

保存后重新尝试ssh -T git@github.com即可。

留下评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注