Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git auth fails after eclipse update 2021-03

After the recent eclipse update 2021-03 all bitbucket.org repositories can't pull/push anymore:

Pulling 1 repository
   [email protected]:Acountxxx/Repoxxx.git: Cannot log in at bitbucket.org:22
   [email protected]:Acountxxx/Repoxxx.git: Cannot log in at bitbucket.org:22

I tried to clone the repositories in a fresh workspace, also using ssh:

URI: ssh://bitbucket.org/REPOxxxx.git
Host: bitbucket.org
Repository Path: REPOxxxxx.git Protocol: ssh
Port: blank
User: blank
Password: blank

Running into the same exception:

ssh://bitbucket.org:Acountxxx/Repoxxx.git: Cannot log in at bitbucket.org:22

The CMD git pull or git push still work fine.

Did anyone have the same issue and found a solution?

Environment:
Windows 10
git version 2.30.1.windows.1
Eclipse 2021-03
EGit: 5.11.0.202103091610-r

EDIT: Also interesting, other repositories e.g. from github still work fine. This behavior is the same for private and public repositories on bitbucket.

like image 886
flavio.donze Avatar asked Mar 22 '21 12:03

flavio.donze


2 Answers

According to the information of howlger about Known_problems -> Bug 572056 - Cannot work with Bitbucket after Eclipse update I did the following workaround which solved the issue.

Open CMD and run:

ssh-keygen -t ed25519

This created a new key: C:/Users/USER/.ssh/id_ed25519

Login to bitbucket and add content of the public key file (C:/Users/USER/.ssh/id_ed25519.pub) as new key:
https://bitbucket.org/account/settings/ssh-keys/

Configure this key in the eclipse preferences:

enter image description here

Afterwards pulling and pushing works again. A little research showed that ed25519 is even more secure and faster then default RSA algorithm, so a very nice solution actually.

like image 192
flavio.donze Avatar answered Sep 28 '22 01:09

flavio.donze


You probably face the following known issue of EGit/JGit 5.11, for which there are two workarounds (see New and Noteworthy of EGit 5.11):

Bug 572056: Connecting to bitbucket.org with an RSA key: the SSH library used has changed in JGit from Apache MINA sshd 2.4.0 to 2.6.0. sshd 2.6.0 by default does public-key authentication for RSA keys using the rsa-sha2-512 signature algorithm only. Servers that do not understand that mechanism but only the older ssh-rsa signature algorithm will then refuse the log-in.

  • Known affected git servers: bitbucket.org, AWS Code Commit
  • Work-arounds:
    • Use an ed25519 key.
    • Use an external SSH via environment variable GIT_SSH.
like image 20
howlger Avatar answered Sep 28 '22 00:09

howlger