当我登录到我的服务器并执行 git pull
时
我得到:
no such identity: /home/admin/.ssh/gitHubKey: No such file or directory
no such identity: /home/admin/.ssh/id_rsa_buhlServer: No such file or directory
Permission denied (publickey).
我必须执行这2个命令:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
它一直有效,直到我注销并再次登录。
注意:我已经生成了 ssh-rsa
并将其保存为新的 ssh key 。
最佳答案
删除
IdentityFile ~/.ssh/gitHubKey
IdentityFile ~/.ssh/id_rsa_buhlServer
来自~/.ssh/config
并仅添加到那里
`IdentityFile ~/.ssh/id_rsa`
如果这不是共享帐户,并且其他人可以使用其他选项。
它应该可以完成这项工作。
关于linux - 我的 vps 上的 git 与 CentOS 7.0 权限被拒绝(公钥)。每次都是致命的 : Could not read from remote repository.,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42679171/