Gitlab 16.0 Community Edition docker image comes with a new baseline image of Ubuntu 22.04. This image comes with OpenSSH 8.9, a release that does not accept ssh-rsa keys by default. See release notes for OpenSSH 8.8.
This caught us by surprise since there is not mention about that in changelogs, and also according to documentation RSA keys are still being supported by Gitlab itself.
But when trying to ssh -Tvvv git@gitlab.our.host the following message appears in the container's logs:
==> /var/log/gitlab/sshd/current <==2023-06-30_07:20:14.92265 userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
I've managed to resolve this issue by adding the following crutch:
This issue was automatically tagged with the label grouppipeline execution by TanukiStan, a machine learning classification model, with a probability of 0.67.
If this label is incorrect, please tag this issue with the correct group label as well as automation:ml wrong to help TanukiStan learn from its mistakes.
To set expectations, GitLab product managers or team members can't make any promise if they will proceed with this.
However, we believe everyone can contribute,
and welcome you to work on this proposed change, feature or bug fix.
There is a bias for action,
so you don't need to wait. Try and spin up that merge request yourself.
If you need help doing so, we're always open to mentor you
to drive this change.
Hi, we also experience the problem and were surprised by lack of this in changelogs. Also the host key using rsa algo is now rejected.
I've found the sshd_config is staticaly put into docker image from omnibus-gitlab so I replaced it using volume in our docker-compose like:
Hey folks, I think there's a small but important confusion here.
When testing this locally on my machine, I created an ssh-rsa key and to my surprise, it worked! After digging and reading the changelog a bit more carefully, I learned that RSA keys were not deprecated. What was deprecated was the support for the SHA1 algorithm to handle signatures. SSH keys do not have these signatures signature built into them. These are prepared by the ssh client and host during during the communication. See this passage:
This release disables RSA signatures using the SHA-1 hash algorithm
by default. This change has been made as the SHA-1 hash algorithm is
cryptographically broken, and it is possible to create chosen-prefix
hash collisions for <USD$50K [1]
For most users, this change should be invisible and there is
no need to replace ssh-rsa keys. OpenSSH has supported RFC8332
RSA/SHA-256/512 signatures since release 7.2 and existing ssh-rsa keys
will automatically use the stronger algorithm where possible.
My expectation is that people having this problem probably have been using a old SSH client. If someone having this problem could confirm to me that they can fix this simply by updating their ssh client, this would be great. See also these references/discussions:
That said, in parallel, I think we can and should still implement a way to optionally enable/disable SHA1 checking on the server side, as proposed by @V0V4N. But I wanted to clarify this as it might be a better solution for users to update their ssh clients.
João Alexandre Cunhachanged title from ssh-rsa keys no longer accepted in Gitlab 16.0 docker image to ssh-rsa keys (SHA-1 with old clients) no longer accepted in Gitlab 16.0 docker image
changed title from ssh-rsa keys no longer accepted in Gitlab 16.0 docker image to ssh-rsa keys (SHA-1 with old clients) no longer accepted in Gitlab 16.0 docker image