Skip to content

How to resolve Server key did not validate or SSH Auth fail error when using eclipse egit

Problem

When using Eclipse to pull source code from a remote repository, you might encounter the following error:

Terminal window
Server key did not validate
ssh://[email protected]:22/yy: Auth fail
org.eclipse.jgit.api.errors.TransportException

Environment

  • Eclipse

Reason

Eclipse uses the EGit plugin to pull source code from remote Git repositories:

image-20201124120724288

EGit is an Eclipse Team provider for the Git version control system. Git is a distributed SCM, which means every developer has a full copy of all history of every revision of the code, making queries against the history very fast and versatile.

The EGit project is implementing Eclipse tooling on top of the JGit Java implementation of Git.

EGit latest release versions:

image-20201124120843382

If you are using older versions of the EGit plugin, you might encounter the following errors:

  • Server key did not validate
  • ssh://[email protected]:22/yy: Auth fail
  • org.eclipse.jgit.api.errors.TransportException

Solution

Step 1: Upgrade to the Latest EGit Plugin

Upgrade to the latest Eclipse EGit plugin version (5.9.0 as of 11.24.2020). You can check the latest version information here.

You can download the latest EGit plugin using one of the following methods:

For system integrators, you can download the EGit p2 repository ZIP from here.

In Eclipse, make sure to select all options when upgrading the EGit plugin online:

image-20201124100809357

Step 2: Restart Eclipse

After upgrading the EGit plugin, restart Eclipse or your computer to apply the changes.

Summary

The “Server key did not validate” or “SSH Auth fail” error in Eclipse EGit is often caused by using outdated versions of the EGit plugin. By upgrading to the latest version of EGit and restarting Eclipse, you can resolve these issues. Always ensure your development tools are up-to-date to avoid compatibility problems and improve productivity.

Final Words + More Resources

My intention with this article was to help others who might be considering solving such a problem. So I hope that’s been the case here. If you still have any questions, don’t hesitate to ask me by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!