首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法添加标识"~/.ssh/id_rsa":代理拒绝操作

无法添加标识"~/.ssh/id_rsa":代理拒绝操作
EN

Stack Overflow用户
提问于 2020-03-03 22:46:37
回答 2查看 2.2K关注 0票数 1

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

代码语言:javascript
运行
复制
** 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和代理也在运行

代码语言:javascript
运行
复制
**/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

这个问题仍然存在

EN

回答 2

Stack Overflow用户

发布于 2021-08-27 13:33:05

来自here的回答和一些评论:

最后一步中使用sudo ssh-add ...

它对我很有效(我也使用了mobaxterm)。

票数 1
EN

Stack Overflow用户

发布于 2020-06-04 19:14:08

我不确定你是否能解决这个问题,但我遇到了同样的问题。

因此您的公钥保存在这里:您的公钥保存在/home/mobaxterm/.ssh/id_rsa.pub中

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

您可能仍会遇到连接问题...对我来说,最好的办法是在本地配置github,使用

代码语言:javascript
运行
复制
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60509777

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档