3

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 :

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.

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.

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

Thanks for your help.

torek
  • 448,244
  • 59
  • 642
  • 775
benblan
  • 95
  • 1
  • 11
  • Is the following enabled? Does disabling or choosing a different SSH agent work? https://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. – howlger Sep 24 '22 at 19:18
  • 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? – benblan Oct 01 '22 at 13:57
  • If you don't have the possibility to choose a different agent, your Eclipse or to be more precise, EGit is outdated. – howlger Oct 02 '22 at 07:06
  • 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! – benblan Oct 04 '22 at 19:27
  • See _Help > About Eclipse IDE: Installation Details_ for the version of _M2E - Maven Integration for Eclipse_. EGit allows you to work more efficiently than on the command line. For example, just drop the GitHub project web site onto your Eclipse to clone that repository. Just make sure to correctly configure it, see for GitHub https://stackoverflow.com/a/68802292/6505250. – howlger Oct 05 '22 at 07:42
  • I checked and I already got the latest version (6.3.0.20220907). I prefer working with EGit than with the CLI. It's just that I would think that handling SSH on Linux would be an easy thing. I will look at the link you gave. Thx – benblan Oct 09 '22 at 06:56
  • 1
    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! – benblan Oct 15 '22 at 06:31

2 Answers2

4

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"

benblan
  • 95
  • 1
  • 11
  • 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! – Mehdi Haghgoo Oct 27 '22 at 20:30
0

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.

  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

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

  • 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. – benblan Oct 01 '22 at 13:46
  • @benblan may be try to run chmod 600 id_rsa. After described above mentioned process everything start to works for me. – Albus_Percival Oct 01 '22 at 14:09
  • id_rsa is already at 600. But still got the problem. – benblan Oct 04 '22 at 19:26