-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
key exhange negotiation failed though client and server share some protocols #17175
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
can reproduce on main ... |
I'm not sure if it's related but after the upgrade I started getting:
I'm also using built-in SSH server and I didn't configure neither |
I'm having the same issue as @synaptiko above. Adding EDIT: Turns out I'm running gitea 1.14.5, so nevermind, I should probably be running the freshest code before complaining 😄 Worked around it personally by just switching to the system's ssh server instead of gitea's internal one. |
Looks like the same issue as here |
Probably golang/go#37278 and it happens with openssh >= 8.8 From https://www.openssh.com/releasenotes.html :
|
Workaround is to specify SSH parameter in
|
Apparently Also to add insult to injury, it seems like gitea's internal ssh server is hard-coded to only generate |
Found some informations here : https://dev.to/cloudx/why-openssh-8-8-cannot-find-a-host-key-type-if-ssh-rsa-is-provided-49i |
Please could you tell us whether you are running the docker, docker-rootless or are running a gitea binary. Please confirm if you are using the internal SSH e.g. (START_SSH_SERVER=true) or an external SSH (START_SSH_SERVER=false) |
Oh damn - this is going to be annoying and difficult to fix. Fundamentally there is a problem in the way that Go's x/crypto/ssh library does the handshake. |
There is a subtle bug in the SSH library x/crypto/ssh which makes the incorrect assumption that the public key type is the same as the signature algorithm type. This means that only ssh-rsa signatures are offered by default. This PR adds a workaround around this problem. Fix go-gitea#17175 Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath in my case we are running the gitea binary on last debian version with the internal SSH server (managed by gitea). |
@Poyoman39 the attached PR will solve the issue. |
For people looking for a workaround way to fix this on their server without people having to make changes to IMO, it's worth looking at moving to ED25519 or another elliptic curve algorithm as the default for Gitea, as RSA is getting closer to being totally broken all the time. |
and probably have a configuration option/GUI option on the admin interface so |
My company's entire ed25519 keys stopped working lmao
nvm all you need to do is generate a new ed25519 key and set it with SSH_SERVER_HOST_KEYS as the guy above said.. can't believe you guys are using RSA key lmao.... also running the via the binary (not docker) @zeripath but seems you figured it out
The easiest solution is just generating an ed25519 and pointing to it, takes <10 seconds FWIW to gitea devs |
Yes but if you got a bunch of different clients connected to the server it would be a PITA to update them all to use the new public key. Although adding back RSA SHA1 on every machine is not ideal either. |
Yep, ed25519 is something that should have been defaulted ~10 years ago. My entire office has to delete their known_hosts line now and accept the new key. Not really that big of a deal. |
For anyone who ends up here, here is how you can easily switch over to ed25519. Use ed25519 on the gitea sideAdd
Don't bother setting In case the keys don't get generated automatically, move to the
Then restart gitea, and look for the following entry in the log
Perhaps the gitea config cheat sheet is useful, if the above stated suggestions don't work for you and you need to dive deeper into the configuration options. Force ssh to use ed25519 for your gitea serverIn my case the above stated steps were enough to fix the issue. If for some reason, you ssh needs to be forced to use ed25519, then see the following template for your
UpdateAddendum: Friend of mine reported, |
* Offer rsa-sha2-512 and rsa-sha2-256 algorithms in internal SSH There is a subtle bug in the SSH library x/crypto/ssh which makes the incorrect assumption that the public key type is the same as the signature algorithm type. This means that only ssh-rsa signatures are offered by default. This PR adds a workaround around this problem. Fix #17175 Signed-off-by: Andrew Thornton <art27@cantab.net> * as per review Signed-off-by: Andrew Thornton <art27@cantab.net>
…tea#17281) Backport go-gitea#17281 There is a subtle bug in the SSH library x/crypto/ssh which makes the incorrect assumption that the public key type is the same as the signature algorithm type. This means that only ssh-rsa signatures are offered by default. This PR adds a workaround around this problem. Fix go-gitea#17175 Signed-off-by: Andrew Thornton <art27@cantab.net>
… (#17376) Backport #17281 There is a subtle bug in the SSH library x/crypto/ssh which makes the incorrect assumption that the public key type is the same as the signature algorithm type. This means that only ssh-rsa signatures are offered by default. This PR adds a workaround around this problem. Fix #17175 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
…tea#17281) * Offer rsa-sha2-512 and rsa-sha2-256 algorithms in internal SSH There is a subtle bug in the SSH library x/crypto/ssh which makes the incorrect assumption that the public key type is the same as the signature algorithm type. This means that only ssh-rsa signatures are offered by default. This PR adds a workaround around this problem. Fix go-gitea#17175 Signed-off-by: Andrew Thornton <art27@cantab.net> * as per review Signed-off-by: Andrew Thornton <art27@cantab.net>
Gitea Version
1.15.3
Git Version
2.33.0
Operating System
CentOS 7
How are you running Gitea?
After a openssh client upgrade, push to gitea
Database
SQLite
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Description
using built-in SSH server with below config:
both client and server have common algorithm, but report
no common algorithm for key exchange
Screenshots
No response
The text was updated successfully, but these errors were encountered: