Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 398085 - EGit does not honor "SSH2 Home" setting
Summary: EGit does not honor "SSH2 Home" setting
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 5.2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 334877 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-01-14 10:04 EST by Arnaud Wizmaster CLA
Modified: 2018-12-03 09:38 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arnaud Wizmaster CLA 2013-01-14 10:04:33 EST
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()
Comment 1 Matthias Sohn CLA 2013-01-16 04:36:55 EST
JGit doesn't know anything about Eclipse hence this needs to be addressed in EGit
Comment 2 Arnaud Wizmaster CLA 2013-01-16 07:35:35 EST
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.
Comment 3 Robin Rosenberg CLA 2013-02-10 12:46:25 EST
We grab SSH settings from Eclipse via EclipseSshSessionFactory, so this should be possible.
Comment 4 Thomas Wolf CLA 2017-08-28 07:04:46 EDT
*** Bug 334877 has been marked as a duplicate of this bug. ***
Comment 5 Thomas Wolf CLA 2017-08-28 07:19:08 EDT
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.
Comment 6 Thomas Wolf CLA 2018-12-03 09:38:36 EST
This should be fixed with the Apache MINA sshd client available in EGit 5.2.0.