Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Username/password popup despite SSH2 auth set up
Username/password popup despite SSH2 auth set up [message #1815122] Wed, 25 September 2019 16:25 Go to next message
Albert Amis is currently offline Albert AmisFriend
Messages: 7
Registered: September 2019
Junior Member
When I set up my Eclipse workspace and the project I'm working on, I set up authorization via Window > Preferences > General > Network Connections > SSH2. This had been working fine for a long time, just as git works on my command line. Recently however, my IDE has started behaving differently. When I try to perform git operations, I get username/password popups. The same exact operation on the command line results in no such prompt. If I try to enter a username/password, the same popup just reappears without even giving an error.
Re: Username/password popup despite SSH2 auth set up [message #1815194 is a reply to message #1815122] Fri, 27 September 2019 05:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30685
Registered: July 2009
Senior Member
No doubt Thomas or Matthias will have a more insightful answer, but one thing you might try is to see if the following preference makes a difference:

"Window -> Preferences -> Team -> Git" where there is a "SSH Client" choice between "Apache MINA sshd", which is relatively new and is a replacement for the other choice, "Jsch", which is very old and poorly maintained.
Re: Username/password popup despite SSH2 auth set up [message #1815227 is a reply to message #1815194] Fri, 27 September 2019 14:10 Go to previous messageGo to next message
Albert Amis is currently offline Albert AmisFriend
Messages: 7
Registered: September 2019
Junior Member
It was already set to Apache MINA sshd. I tried changing it to Jsch, and that didn't work either, so I changed it back.
Re: Username/password popup despite SSH2 auth set up [message #1815343 is a reply to message #1815227] Tue, 01 October 2019 07:32 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 174
Registered: August 2016
Senior Member
Strange. Are you sure that both command-line ssh/git and Eclipse are using the same SSH config? What's the "SSH2 Home" directory? Which authentication methods are enabled on the SSH2 preference page?
Re: Username/password popup despite SSH2 auth set up [message #1815370 is a reply to message #1815343] Tue, 01 October 2019 14:37 Go to previous messageGo to next message
Albert Amis is currently offline Albert AmisFriend
Messages: 7
Registered: September 2019
Junior Member
Under Window > Preferences > Team > Git > Configuration there is a System Settings tab. There the location is set to C:\Users\{username}\AppData\Local\Programs\Git\mingw64\etc\gitconfig. One of the keys there is "http", which in turn contains "sslBackend", which is set to "openssl" and "sslCAInfo", which is set to that mingw64 folder followed by "ssl/certs/ca-bundle.crt".

I didn't notice any setting for "SSH2 Home" in the Eclipse preferences.
Re: Username/password popup despite SSH2 auth set up [message #1815379 is a reply to message #1815370] Tue, 01 October 2019 21:33 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 174
Registered: August 2016
Senior Member
It's at Window > Preferences > General > Network Connections > SSH2. That preference page has several tabs, the first one contains the "SSH2 Home" setting, and one of the other tabs shows which authentication methods are enabled.

Also, I meant the SSH config, not the git config. Which SSH config is used by command-line git?

[Updated on: Tue, 01 October 2019 21:36]

Report message to a moderator

Re: Username/password popup despite SSH2 auth set up [message #1815417 is a reply to message #1815379] Wed, 02 October 2019 13:54 Go to previous messageGo to next message
Albert Amis is currently offline Albert AmisFriend
Messages: 7
Registered: September 2019
Junior Member
SSH2 home: C:\Users\{username}\.ssh

Private keys: id_dsa,id_rsa

The former key is absent from that location, but the latter is present and matches the public key there.
Re: Username/password popup despite SSH2 auth set up [message #1815419 is a reply to message #1815417] Wed, 02 October 2019 14:10 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 174
Registered: August 2016
Senior Member
Which authentication methods are enabled on the SSH2 preference page? In particular, is "publickey" enabled and above password or keyboard-interactive?

Do you have a file C:\Users\{username}\.ssh\config, and if so, what are the contents relevant for the host you're trying to connect to? Is that the same config file that is also used by command-line ssh? Or does command-line git use PuTTY?

Are you using a proxy?

Which Eclipse and EGit version does this occur with?

Are there any entries in the error log (in your workspace, under .metadata) that are relevant?

Since you wrote it started recently: could it be a problem with the Eclipse secure storage? If your key has a passphrase, it should be stored in there. You should be able to verify by checking the content of the secure store via the Eclipse preferences.
Re: Username/password popup despite SSH2 auth set up [message #1815421 is a reply to message #1815419] Wed, 02 October 2019 14:43 Go to previous messageGo to next message
Albert Amis is currently offline Albert AmisFriend
Messages: 7
Registered: September 2019
Junior Member
The "Authentication Methods" tab has all four checkboxes marked, including publickey. keyboard-interactive is the very last one at the bottom.

~/.ssh only contains a public key, a private key, and known_hosts. I haven't been directly using ssh on the command line, but the "ssh" command executes and I don't think PuTTY is installed.

I don't think I'm using any kind of proxy.

The IDE is Spring Tool Suite Version 4.3.0.RELEASE with Eclipse Platform 4.1.2.0.v20190605-1801 and Eclipse Git 5.4.0.201906121030-r.

There's no .metadata in the workspace. In another workspace created when I first installed the IDE there's one that just contains version.ini

The Git preferences in Eclipse have a Secure Store checkbox to store credentials by default, but this checkbox is not checked. I don't think I ever stored a password/passphrase, since I've just been relying on the ssh key to access github.
Re: Username/password popup despite SSH2 auth set up [message #1815440 is a reply to message #1815421] Wed, 02 October 2019 20:25 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 174
Registered: August 2016
Senior Member
Strange that there should be no .metadata folder in an Eclipse workspace...

But OK, you're accessing a repo on Github, and you don't have any SSH config file.

Is the URI 100% correct? ssh://git@github.com/user/repo.git ? Or git@github.com:user/repo.git ? Just asking; I've seen several times people using by mistake ssh://user@github.com/... and that won't work and will lead to username/password prompts.

Otherwise I'm a bit out of ideas. There must be some strange configuration problem if neither JSch nor Apache MINA work, but right now I have no idea where to look.

You could try doing a git fetch with the JGit command-line application, but I've never tried that on Windows. There's some instructions on how to run that with debug logging on at https://bugs.eclipse.org/bugs/show_bug.cgi?id=545920#c5 . (I'd use the latest "self-contained command-line executable from https://www.eclipse.org/jgit/download/ though. Probably needs to be run in the git bash shell on Windows.)
Re: Username/password popup despite SSH2 auth set up [message #1815443 is a reply to message #1815440] Wed, 02 October 2019 20:51 Go to previous messageGo to next message
Albert Amis is currently offline Albert AmisFriend
Messages: 7
Registered: September 2019
Junior Member
The workspace's .git/config file contains a url of the form
url = https://gitlab.{domain}.com/blahblahblah

Yes, that's gitlab rather than github. I conflated the two earlier. There's no username in the url, nor any "git@" or "ssh@".
Re: Username/password popup despite SSH2 auth set up [message #1815445 is a reply to message #1815443] Wed, 02 October 2019 22:05 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 174
Registered: August 2016
Senior Member
So, you're not using SSH at all but HTTPS?

That changes everything.

Change the url to ssh://git@gitlab.domain.com/blahblahblah if you want to use SSH. Don't know why command-line git doesn't prompt for username/password with HTTPS, though.
Re: Username/password popup despite SSH2 auth set up [message #1815493 is a reply to message #1815445] Thu, 03 October 2019 13:48 Go to previous message
Albert Amis is currently offline Albert AmisFriend
Messages: 7
Registered: September 2019
Junior Member
After making that change it's not asking me to log in anymore, so it looks like that may have done the trick. There is a "[lock fail]" error for a particular branch being pulled, but that might be something particular to that branch or some temporary state in my workspace.
Previous Topic:Ability to pull from multiple repos seems to have been removed
Next Topic:Suddenly getting "No more authentication methods available" with ssh auth to git repo
Goto Forum:
  


Current Time: Fri Dec 06 21:36:02 GMT 2019

Powered by FUDForum. Page generated in 0.02156 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top