【问题标题】:Could not add identity "~/.ssh/id_rsa": agent refused operation无法添加身份“~/.ssh/id_rsa”:代理拒绝操作
【发布时间】:2021-08-27 21:33:04
【问题描述】:

我已经成功生成了 ssh 密钥,但是当我尝试将它添加到 ssh-agent 时,它显示了这个错误

** 03/03/2020   19:39.04   /home/sahilra/Desktop/DOcs/Web_Dev/git_projects ** ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mobaxterm/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mobaxterm/.ssh/id_rsa.
Your public key has been saved in /home/mobaxterm/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:ISmtoclG2l6aWE9wHa4AS/4jzXKy/cVJk93sU7XJNw4 sahilra@SAHILRA01
The key's randomart image is:
+---[RSA 2048]----+
|..    .          |
|oo   + o         |
|..+ + * .      . |
| =+* = .o.o   o o|
|.+B*=  +S. o E =.|
| =B*. o o . . o o|
|..+..  +   o   . |
|    . .     .    |
|     .           |
+----[SHA256]-----+

$SSH_AUTH_SOCk=/tmp/ssh-I4LHdw/agent.2102 并且代理也在运行

**/home/sahilra/Desktop/DOcs/Web_Dev/git_projects ** ssh-add ~/.ssh/id_rsa
Could not add identity "/home/mobaxterm/.ssh/id_rsa": agent refused operation

问题仍然存在

【问题讨论】:

    标签: github command-line


    【解决方案1】:

    here 与一些 cmets 的回答:

    • 在最后一步使用sudo ssh-add ...

    它对我有用(我也使用过 mobaxterm)。

    【讨论】:

    • 您在 Windows 上使用 Mobaxterm 吗?我不能sudo也不能安装它
    【解决方案2】:

    不确定您是否能够解决此问题,但我遇到了同样的问题。

    所以你的公钥保存在这里:你的公钥已经保存在 /home/mobaxterm/.ssh/id_rsa.pub

    您可以剪辑 > /home/mobaxterm/.ssh/id_rsa.pub 然后将其添加到您的 github 帐户。

    您可能仍然会遇到连接问题...对我来说,解决方法是使用本地配置 github

    $ git config --global user.name "John Doe"
    $ git config --global user.email johndoe@example.com
    

    【讨论】:

      猜你喜欢
      • 2020-05-20
      • 2020-09-26
      • 2012-03-27
      • 2019-02-26
      • 2021-02-10
      • 2011-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多