Egit 验证失败(ssh 配置)

auth failed with Egit (ssh configuration)

Gitbash 命令行一切正常:我可以执行结帐、git 拉、git 推等。但它不适用于 egit.

我使用 STS 3.6.4.RELEASE 和插件 egit 版本 3.7

我已经在 eclipse(STS) > 常规 > 网络连接 > SSH2 中添加了我的 id_rsa。我在私钥字段和 SSH2 主页中添加了正确的 id_rsa :.ssh 我还在 Eclipse 代理规则中添加了绕过规则

但是我在获取、提交或其他命令时仍然有同样的错误:

ssh://"username"@"host":29418/"project_folder": Auth fail

堆栈跟踪:

org.eclipse.jgit.api.errors.TransportException: ssh://jjack@aurora.credi-ouest.cnamts.fr:29418/navigo: Auth fail at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139) at org.eclipse.egit.core.op.FetchOperation.run(FetchOperation.java:134) at org.eclipse.egit.ui.internal.fetch.FetchOperationUI.execute(FetchOperationUI.java:103) at org.eclipse.egit.ui.internal.fetch.FetchOperationUI.runInWorkspace(FetchOperationUI.java:123) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: org.eclipse.jgit.errors.TransportException: ssh://jjack@aurora.credi-ouest.cnamts.fr:29418/navigo: Auth fail at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:159) at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136) at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.(TransportGitSsh.java:262) at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161) at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136) at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122) at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138) at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130) ... 5 more Caused by: com.jcraft.jsch.JSchException: Auth fail at com.jcraft.jsch.Session.connect(Session.java:512) at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116) ... 12 more

我的同事在 eclipse 中有相同的配置,但对他有效。 我已经看过这个 SO 答案:auth failed error with egit and github

我在 .ssh/id_rsa 中放错了元素。我把 public 密钥放在 openssh 格式而不是 "putty" 格式的私钥。 修复它的最简单方法是使用 "general > Network connections > SSH2 >key management > load existing key" 在 egit 中导入 id_rsa.ppk,然后将私钥保存在 id_rsa 文件中。