Hi,
OpenSSH disabled the ssh-rsa signature scheme and now when I want to push/pull to/from my repositories I receive the following error:
Unable to negotiate with 104.192.141.1 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
What can I do to make it work?
This worked for me:
Host bitbucket.org
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
~/.ssh/config
Well, although this works, this is a workaround, rather than a solution. There is a very good security reason, OpenSSH (finally) disabled ssh-rsa (which is based on SHA-1, theoretially broken 2004, practially broken 2017, cheaply broken 2020 )
The solution is for bitbucket to allow up-to-date hash algorithms.
See my related question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@joel.kuepper are you having trouble adding keys with newer hashing algorithms? Support for ECDSA and ED25519 SSH keys was added in August 2016 - https://bitbucket.org/blog/ssh-improvements-bitbucket-cloud
Or, is it a different one other than ECDSA or ED25519 that you're looking for?
//Edit: Ah, I see the issue. Bitbucket Cloud is not offering a new algorithm for the host key.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jeff Thomas Yes, you are correct, I am referring to the host key algorithm. So what happens now that you are aware of this?
(When) can we expect Bitbucket to offer new hash algorithms (in the coming days, weeks, months)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jeff Thomasplease fix ASAP, any day now and when ubuntu/windows update openssh this issue will really explode
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not from the Bitbucket Cloud team, but that team is aware of the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Helped me a lot, thanks ser!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello.
Please vote tickets !
- https://jira.atlassian.com/browse/BSERV-10175 for Bitbucket Server on-premise
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gracias Hermano !! Esto si que me ayudo !!!
Thanks Carlos,Helped me a lot !!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This helped. Would be good to allow newer algos, I have to use newer algos with other tools so I have to balance multiple keys until this is solved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just FYI, if you did not follow the issue-tracker; it is solved now. You can remove the +ssh-rsa entry from the config file
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bitbucket have had a long time to support other keys. AWS also has lagged here but for authentication public keys (not host keys) but now supports ED25519.
Bitbucket has just stood there and done absolutely nothing and the only way to use it now is to lower the security of your system.
If you apply the security degrading workaround make sure it is JUST for the bitbucket.org host and not everything.
Hopefully this will help organisations break the "well its free with Jira so let's just use it" way of thinking and move to a real Git hosting provider.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
LMAO how is this not fixed yet?! 1 week away from this issue turning a month old putting aside the enormous complacency that led to this debacle in the first place.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi everyone,
One of our engineering managers has published a community article with more info on the issue as well as workarounds:
The Bitbucket team is working on adding the updated signature support to our SSH server and we will provide another update once these changes have been implemented.
If you'd like to get notified on updates, you can watch either the community article or this BCLOUD ticket.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As of 2021-10-01 I cannot connect to Bitbucket via SSH without re-enabling ssh-rsa after updates on Arch Linux. It's absolutely ridiculous, that I just went through the support article recommending to use ed25519 key and finding out that Bitbucket does not accept ed25519 :-D
Atlassians, please fix this.
Unable to negotiate with 104.192.141.1 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try the config change from my comment above? I'm also using Arch and ED25519 is working, but I had to add the `HostKeyAlgorithms +ssh-rsa` line to my `~/.ssh/config` file for bitbucket.org in order for it to work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@marcusball Didn't work on windows
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just started getting this issue today, as well. This seems absolutely ridiculous that Bitbucket hasn't upgraded to support any of the new SSH key types yet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately this is my company's repo; I'd move it over in a heartbeat if it wouldn't mean migrating everyone else and the various connected services.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, I think I figured out a solution. I used some of the SSH config change from this answer, and created a new SSH key based on this article.
Basically, I made a new key using ED25519 (`ssh-keygen -t ed25519`), added it to my Bitbucket profile, and added ssh-rsa to the HostKeyAlgorithms in `~/.ssh/config`:
Host bitbucket.org
User git
IdentityFile ~/.ssh/id_ed25519
HostKeyAlgorithms +ssh-rsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I hope you know what that means. OpenSSH disabled this insecure algorithm, and you explicitly enable it again. This should not be a long-term solution imo, but we can only wait for bitbucket to fix this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On OpenBSD 6.9, OpenSSH 8.6 this problem does not exist. On my laptop I'm on OpenBSD-current, which now uses OpenSSH 8.7 and I think it's because they made this change:
OpenSSH will disable the ssh-rsa signature scheme by default in the next release. In the SSH protocol, the "ssh-rsa" signature scheme uses the SHA-1 hash algorithm in conjunction with the RSA public key algorithm. It is now possible[1] to perform chosen-prefix attacks against the SHA-1 algorithm for less than USD$50K. Note that the deactivation of "ssh-rsa" signatures does not necessarily require cessation of use for RSA keys. In the SSH protocol, keys may be capable of signing using multiple algorithms. In particular, "ssh-rsa" keys are capable of signing using "rsa-sha2-256" (RSA/SHA256), "rsa-sha2-512" (RSA/SHA512) and "ssh-rsa" (RSA/SHA1). Only the last of these is being turned off by default. This algorithm is unfortunately still used widely despite the existence of better alternatives, being the only remaining public key signature algorithm specified by the original SSH RFCs that is still enabled by default. The better alternatives include: * The RFC8332 RSA SHA-2 signature algorithms rsa-sha2-256/512. These algorithms have the advantage of using the same key type as "ssh-rsa" but use the safe SHA-2 hash algorithms. These have been supported since OpenSSH 7.2 and are already used by default if the client and server support them. * The RFC8709 ssh-ed25519 signature algorithm. It has been supported in OpenSSH since release 6.5. * The RFC5656 ECDSA algorithms: ecdsa-sha2-nistp256/384/521. These have been supported by OpenSSH since release 5.7. To check whether a server is using the weak ssh-rsa public key algorithm, for host authentication, try to connect to it after removing the ssh-rsa algorithm from ssh(1)'s allowed list: ssh -oHostKeyAlgorithms=-ssh-rsa user@host If the host key verification fails and no other supported host key types are available, the server software on that host should be upgraded. OpenSSH recently enabled the UpdateHostKeys option by default to assist the client by automatically migrating to better algorithms. [1] "SHA-1 is a Shambles: First Chosen-Prefix Collision on SHA-1 and Application to the PGP Web of Trust" Leurent, G and Peyrin, T (2020) https://eprint.iacr.org/2020/014.pdf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Facing the same issue here. Not sure if the fact that I heavily rely on the .ssh/config file helps on make this issue happen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Me too, I added
HostbasedAcceptedAlgorithms +ssh-rsa
but it didn't help.
Wondering about migrating my repos to GitHub. This issue does not exist there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I made a quick research and sounds like the issue when using OpenSSH >= 8.5
If you're using an OS that already upgrade to this version (or higher) the best solution for now is creating Access Tokens and updating the remote URL address to HTTP format
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I really appreciate all the help provided by this forum, I was dealing with this issue for a long, it did work, also, I'd like to share this information about SSH on Kali https://linuxhint.com/enable_ssh_kali_linux/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.