You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RSA public key authentication fails with OpenSSH 8.8 #634
Describe the bug
OpenSSH 8.8 has disabled the ssh-rsa authentication algorithm. Since libssh2 doesn't support rsa-sha2-256 or rsa-sha2-512 it can no longer do RSA public key authentication against the most popular SSH server implementation.
To Reproduce
Upgrade OpenSSH to version 8.8
Configure rsa public key in .ssh/authorized_keys
Connect using rsa private key with example/ssh2
Authentication is rejected and sshd will complain that userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
Expected behavior
libssh2 should switch to rsa-sha2-256 or rsa-sha2-512 perhaps even trying these first.
Version (please complete the following information):
Fedora 34, but any Linux distribution will do if updated to latest OpenSSH version
libssh2 version 1.10.0
Additional context
These changes are described in the OpenSSH Release Notes
Potentially-incompatible changes
================================
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.
I have been working to support RFC 8332 in libssh2 but feeling a little out of my depth.
I can send rsa-sha2-256 as the public key method in _libssh2_userauth_publickey() in userauth.c and have changed the signing functions to use SHA256 instead of SHA1 but my signature doesn't match.
It also isn't clear to me when to stick with the old ssh-rsa method and when to use rsa-sha2-256 without having to try and potentially fail authentication which some servers will hold against the client.
changed the title [-]RSA public key authentication fails with OpenSSH 8.8 default configurations[/-][+]RSA public key authentication fails with OpenSSH 8.8[/+]on Oct 26, 2021
Activity
palmin commentedon Oct 26, 2021
I have been working to support RFC 8332 in libssh2 but feeling a little out of my depth.
I can send
rsa-sha2-256as the public key method in_libssh2_userauth_publickey()in userauth.c and have changed the signing functions to use SHA256 instead of SHA1 but my signature doesn't match.It also isn't clear to me when to stick with the old
ssh-rsamethod and when to usersa-sha2-256without having to try and potentially fail authentication which some servers will hold against the client.[-]RSA public key authentication fails with OpenSSH 8.8 default configurations[/-][+]RSA public key authentication fails with OpenSSH 8.8[/+]willco007 commentedon Oct 26, 2021
This is a duplicate of #536 which has a pending PR #626, please check it out if you're interested.