Community
Participate
Working Groups
JGit has hard coded the location of the .ssh directory (and of the contained files "config" or "known_hosts") in the home directory of the user and does not honor the custom location that may be given in "Preferences > General > Network Connections > SSH2 > SSH2 Home" Steps to reproduce: 1. Have your .ssh folder in a custom location and a config file that points to an identity file Host example.com IdentityFile .ssh/id_dsa 2. Configure Eclipse to use this folder 3. Try to fetch from this host through SSH Result: JGit ignore the file and prompt for password. Expected result: JGit should use the configured .ssh location and find the identity file. Known faulty code: - org.eclipse.jgit.transport.JschConfigSessionFactory.identities() - org.eclipse.jgit.transport.OpenSshConfig.get()
JGit doesn't know anything about Eclipse hence this needs to be addressed in EGit
I understand that EGit needs to provide Eclipse specific functions (and feeding the SSH2 home location to JGit), but in that case I guess the home folder hard wiring in the JGit implementation will be difficult to overcome.
We grab SSH settings from Eclipse via EclipseSshSessionFactory, so this should be possible.
*** Bug 334877 has been marked as a duplicate of this bug. ***
See also bug 335897 and an old change referenced there: https://git.eclipse.org/r/#/c/4775 . I don't think we should do such merging of different ssh config files as in that Gerrit change. If we wanted that, we should implement the "Include" key in the ssh config parser. (But then we'd also have to check several files' modification times to decide when to reload.) But EGit should indeed use the configured "SSH2 Home" as the directory where it reads the ssh config, if any, from.
This should be fixed with the Apache MINA sshd client available in EGit 5.2.0.