gpt4 book ai didi

Eclipse Git SSH : Could not connect to SSH agent via socket(Eclipse Git SSH:无法通过套接字连接到SSH代理)

转载 作者:bug小助手 更新时间:2023-10-25 10:56:00 30 4
gpt4 key购买 nike



I'm trying to use Eclipse (2022-09 version) egit to clone a Github repo using ssh under Linux Mint.
When I do, I get an eclipse error message :

我正在尝试使用Eclipse(2022-09版本)egit在Linux Mint下使用ssh克隆Github repo。当我这样做时,我得到一个eclipse错误消息:


DefaultAuthFuture[ssh-connection]: Failed (IOException) to execute: Could not connect to SSH agent via socket '/run/user/1000/keyring/ssh'

I'm using a rsa private key (but not the default id_rsa) which is registered with Github. I also created a .ssh/config file to specify the right identity.

我使用的是注册到Github的rsa私钥(而不是默认的id_rsa)。我还创建了一个.ssh/config文件来指定正确的身份。


When cloning the repo with the git command line, it works.
In the Eclipse preferences, in SSH2 menu, I have set the identify in private keys field.
I also see that I don't have any ssh_agent in the SSH Agent tab. But I can't add anything.

当使用git命令行克隆repo时,它可以正常工作。在Eclipse首选项中,在SSH2菜单中,我已经设置了IDENTIFY in Private Key字段。我还看到在SSH代理选项卡中没有任何ssh_agent。但我不能再补充什么了。


I know that there have always been some problems with egit ssh on Linux. But I can't find my error anywhere.

我知道在Linux上使用egit ssh总是有一些问题。但我在任何地方都找不到我的错误。


Thanks for your help.

谢谢你的帮助。


更多回答

Is the following enabled? Does disabling or choosing a different SSH agent work? wiki.eclipse.org/EGit/New_and_Noteworthy/6.1#SSH_Agent_Support It can also depend on your Git configuration, which you didn't tell.

是否启用了以下功能?禁用或选择不同的SSH代理是否有效?Wiki.eclipse.org/EGit/New_and_Noteworthy/6.1#SSH_Agent_Support它也可能取决于你的Git配置,而你并没有告诉它。

Hi, on Unix it seems you don't have the possibility to choose a different agent. Or at least, I can't choose anything. What Git configuration would you like to see?

嗨,在Unix上,您似乎没有可能选择不同的代理。或者至少,我什么都不能选择。您希望看到哪些Git配置?

If you don't have the possibility to choose a different agent, your Eclipse or to be more precise, EGit is outdated.

如果您不能选择不同的代理,您的Eclipse,或者更准确地说,EGit已经过时了。

Maybe, but my eclipse is 2022-09 build so I think it's pretty up to date. But I agree EGit is not a great tool!

也许吧,但我的月食是2022-09年的版本,所以我认为它是相当新的。但我同意EGit不是一个很好的工具!

Hi, I finally found a workaround by disabling the use of ssh-agent in Eclipse. It was your first hint but I only tried to change a different SSH agent. So thank you!

您好,我终于找到了一种解决方法,即在Eclipse中禁用ssh-agent。这是您的第一个提示,但我只是尝试更改不同的SSH代理。所以谢谢你!

优秀答案推荐

I didn't find the explanation of the problem that seems to be caused by the ssh-agent installation on my machine.
But disabling the ssh-agent in Eclipse works (Preferences > Git > unselect "Use SSH Agent for SSH connections"

我没有找到这个问题的解释,这个问题似乎是由我机器上的ssh代理安装引起的。但是在Eclipse中禁用ssh代理是可行的(首选项>Git>取消选择“Use SSH Agents for SSH Connections”



hope next advice will be helpful, it's based on a similar problem what i had on my Ubuntu, so there will be no problem for you to adjust commands for Linux Mint.

希望下一条建议会有帮助,它是基于我在我的Ubuntu上遇到的类似问题,所以对你来说调整Linux Mint的命令不会有问题。



  1. run next command:


    chmod 600 id_rsa



  2. cd to your project directory



  3. Run command to clone your repository:


    git clone put-your-ssh-git-repo-url



  4. Then you will be prompted to accept that authentication of the host couldn't be verified & after accepting that it started getting the repository.



  5. The repository cloned and created some necessarily files what you are missing to recognize the .ssh key.




hope after above you can start to use git from eclipse

希望在完成上述工作后,您可以开始使用eclipse中的git。


P.S check for new files in /.ssh/ , should be a new known_hosts file

P.S检查/.ssh/中的新文件应该是新的已知主机文件



The solutions in this

这其中的解决方案


As a quick fix, add "IdentityAgent none" in your ~/.ssh/config host entry. is the solution worked for me

作为一种快速修复方法,在~/.ssh/config主机条目中添加“IdentityAgentNone”。这个解决方案对我有效吗?


更多回答

Works like a charm. Probably the reason is that no agent is defined inside the IDE by default and still it is set to use SSH Agent!

就像一种护身符。可能是因为默认情况下没有在IDE内部定义代理,并且仍然将其设置为使用SSH代理!

Hi, cloning using the git CLI already works. In fact, this is how I currently work. I clone the repo using git and then import the project into Eclipse. But I can't use Eclipe topush or update my repo. So I do all git related actions with the CLI.

嗨,使用git CLI的克隆已经可以工作了。事实上,这就是我目前的工作方式。我使用GIT克隆了repo,然后将项目导入到Eclipse中。但我不能使用黄道顶推或更新我的回购。因此,我使用CLI执行所有与GIT相关的操作。

@benblan may be try to run chmod 600 id_rsa. After described above mentioned process everything start to works for me.

@benblan可能正在尝试运行chmod 600 id_rsa。在描述了上述过程之后,一切开始对我起作用。

id_rsa is already at 600. But still got the problem.

id_rsa已经是600了。但还是有问题。

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com