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
This is probably because you are using an RSA key to authenticate. OpenSSH-8.8 disables support for RSA keys/signatures using SHA-1 hash by default. Paramiko does not yet support RSA keys/signatures using SHA-2 hashes. You'll need something like #1643 and probably some additional tweaks. Or, use an ECDSA or ED25519 key instead.
The problem is, that "ssh-rsa" has multiple meanings. One problem with paramiko is, that it reads the key-type from a publickey file and the key-type is used as hash type during the authentication. This only works for sha1 hashes, because they are also defined as "ssh-rsa".
According to RFC-4252, publickey authentication is split in 2 steps. The first (optional) step is to ask the server, if a publickey is known. In the second step a signature is sent to the server, which is the real authentication step.
If the first step fails, because SHA1 hashes are not supported, the whole authentication fails.
Paramiko has implemented the publickey authentication with both steps and fails on the first step, which is the publickey lookup.
When speaking of hash types SSH defines ssh-rsa as SHA1 hash. For SHA512 hashes the hash type is rsa-sha2-512.
I have implemented a test application, which is able to lookup, if a publickey is known by the server. This application only implements the first step of the publickey authentication process. When using the current implementation of paramiko, the key lookup fails for OpenSSH 8.8.
Activity
ploxiln commentedon Oct 24, 2021
This is probably because you are using an RSA key to authenticate. OpenSSH-8.8 disables support for RSA keys/signatures using SHA-1 hash by default. Paramiko does not yet support RSA keys/signatures using SHA-2 hashes. You'll need something like #1643 and probably some additional tweaks. Or, use an ECDSA or ED25519 key instead.
austinbutler commentedon Nov 9, 2021
As stated using an ED25519 key works. I was able to get an RSA key working by combining #1643 and #1606 in a branch off
paramiko2.8.0.manfred-kaiser commentedon Nov 27, 2021
The problem is, that "ssh-rsa" has multiple meanings. One problem with paramiko is, that it reads the key-type from a publickey file and the key-type is used as hash type during the authentication. This only works for sha1 hashes, because they are also defined as "ssh-rsa".
According to RFC-4252, publickey authentication is split in 2 steps. The first (optional) step is to ask the server, if a publickey is known. In the second step a signature is sent to the server, which is the real authentication step.
If the first step fails, because SHA1 hashes are not supported, the whole authentication fails.
Paramiko has implemented the publickey authentication with both steps and fails on the first step, which is the publickey lookup.
When speaking of hash types SSH defines ssh-rsa as SHA1 hash. For SHA512 hashes the hash type is rsa-sha2-512.
I have implemented a test application, which is able to lookup, if a publickey is known by the server. This application only implements the first step of the publickey authentication process. When using the current implementation of paramiko, the key lookup fails for OpenSSH 8.8.
paramiko/paramiko/auth_handler.py
Line 290 in 13f28d6
If the key is a "ssh-rsa" key type, my application forces a "rsa-sha2-512" hash, and the key loopup is possible:
https://github.com/ssh-mitm/ssh-mitm/blob/dbc920d9a93304b24a5b71d766c6210c531eb9b8/ssh_proxy_server/authentication.py#L52:L55
@bitprophet We will try to fix this issue in the next weeks. Is there a deadline for the fix?
bitprophet commentedon Dec 23, 2021
Paramiko 2.9 will be out today and fixes this!