在从另一个(本地)存储库推送到github帐户后,我似乎失去了对该帐户的权限。我现在收到以下错误:
git push
Permission denied (publickey).fatal:
The remote end hung up unexpectedly
然后,我采取了以下步骤来重新生成密钥:
ssh-keygen
Set up an ssh on my account for this laptop, using id_rsa.pub
然而,这是不成功的。当我尝试以下建议的代码时,我收到以下错误:
ssh-add -l
Could not open a connection to your authentication agent.
有什么想法吗?
发布于 2013-08-30 19:13:30
如果您在~/.ssh中已经有一个公钥(并且已经将该密钥添加到您的github帐户中),那么您可能只需要再次将您的密钥加载到SSH代理中。
要测试SSH代理是否具有密钥,如果结果是,请键入ssh-add -l
:
The agent has no identities.
然后,只需将密钥加载到SSH代理中,如下所示:
ssh-add ~/.ssh/github_rsa
(github_rsa是我机器上存储的SSH密钥的名称。该文件也可以命名为: id_rsa)
在此之后,您必须输入密钥的密码短语(这很可能是您登录github的密码)。如果您收到如下消息:
Identity added: /Users/name/.ssh/github_rsa (/Users/cpotzinger/.ssh/github_rsa)
发布于 2014-05-07 17:28:36
做一个$ ssh-add
,这对我来说也解决了gitlab的以下问题
jovimac-2:work joviano$ git clone git@git.xyz.com:bjetfweb.git
Cloning into 'bjetfweb'...
Access denied.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
https://stackoverflow.com/questions/9560892
复制相似问题