Using SSL certificates with eGit [message #1822019] |
Tue, 25 February 2020 16:40  |
Eclipse User |
|
|
|
I cannot get eGit to work using SSH for push/pull with a GitLab repository. I've been using Git Bash to do all push/pull/fetch operations at the command line. That works fine. I set that up by creating an SSH key and pasting it into the web UI of GitLab. All I had to do locally was use the SSH URL for the remote and now it works without asking for a password. I just push/pull/fetch and it works.
The URL looks like this:
ssh://gitlab@ourgitlabserver.com/myuserid/my--repository--name.git
I cannot get this working with Eclipse eGit. I've found 3 sites online with instructions but all of them are missing a few steps (like how to authenticate). None answer the question I have (use SSL).
I can tell Eclipse to use SSH - same URL as what works with command line - but when I try to do a fetch it asks for a password. I have no idea what password it could possibly want. I've tried my password and that does not work. Besides, I thought the whole point of using SSL certificates was to NOT enter your password every time? Why can't Eclipse just use SSL and do what the command line is doing?
What am I missing? I have no idea what a next step would be. Ideas?
|
|
|
|
|
Re: Using SSL certificates with eGit [message #1822199 is a reply to message #1822174] |
Sat, 29 February 2020 12:34  |
Eclipse User |
|
|
|
So it looks as if your gitlab server really is configured to use "gitlab" as user name. Just wanted to make sure that's really the case; it's a bit unusual and it wouldn't have been the first time that some copy-paste error threw analysis off. Recently there was someone who complained about SSH, and in the end it turned out he used an https URI.
The user name doesn't matter at all for EGit.
Re (3): So there is a "%HOME%\.ssh" directory, and it does contain your id_rsa and id_rsa.pub files. There is no config file, which is OK. Eclipses SSH2_HOME preference points to the same directory.
Which SSH client library do you use in Eclipse? Check in Eclipse under Preferences->Team->Git; you can choose between "Jsch" and "Apache MINA sshd". Does the problem occur with both?
If you don't see any option to choose on that preference page, then you are using an old EGit version. Upgrade to EGit nightly from the update site https://download.eclipse.org/egit/updates-nightly .
Which EGit version are you using anyway? If it's older than 5.6, I'd recommend upgrading to EGit nightly in any case.
It could also be a problem with the private key file itself. Perhaps it's in some format that Eclipse doesn't understand. Did you generate that key recently? If so, how? Does the key have a passphrase? (The way ssh-keygen writes private keys has changed a while ago, and only a recent EGit version will be able to read such keys.)
And no, it's not a SSHv1 vs. SSHv2 problem. EGit uses SSHv2. (I think nowadays almost everyone and everything uses that, only some embedded devices still have old SSHv1 servers.)
|
|
|
Powered by
FUDForum. Page generated in 0.04609 seconds