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
If the host is a legacy SSH server which doesn't support rsa-sha2-256/512 signatures, you need to use disabled_algorithms={'keys': ['rsa-sha2-256', 'rsa-sha2-512']} to fix it.
I have the same issue. Downgrading to 2.8.1 helps. Downgrading to 2.9.0 does not help. Passing disabled_algorithms={'keys': ['rsa-sha2-256', 'rsa-sha2-512']}does not help
Traceback (most recent call last):
File "/home/project_folder/project/common/scp.py", line 105, in __enter__
self._ssh.connect(**ssh_credentials)
File "/home/project_folder/.venv/lib/python3.9/site-packages/paramiko/client.py", line 435, in connect
self._auth(
File "/project_folder/.venv/lib/python3.9/site-packages/paramiko/client.py", line 766, in _auth
raise saved_exception
File "/project_folder/.venv/lib/python3.9/site-packages/paramiko/client.py", line 742, in _auth
self._transport.auth_publickey(username, key)
File "/project_folder/.venv/lib/python3.9/site-packages/paramiko/transport.py", line 1634, in auth_publickey
return self.auth_handler.wait_for_response(my_event)
File "/project_folder/.venv/lib/python3.9/site-packages/paramiko/auth_handler.py", line 258, in wait_for_response
raise e
paramiko.ssh_exception.AuthenticationException: Authentication failed.
I have the same issue. Downgrading to 2.8.1 helps. Downgrading to 2.9.0 does not help. Passing disabled_algorithms={'keys': ['rsa-sha2-256', 'rsa-sha2-512']}does not help
I don't know the version and am unable to check the logs as it is the remote client's server.
I figured out that commenting out these both two lines works for me:
Reacted by Vitali Rebkavets, Marc Swingler, realcp1018, backbord, sharada-keeli, Duong Quang Duc, 星辰大海, aixushuai, Hugo Alvarado, Andrii Besaha and 1 more
Good spot @jun66j5 - it's arguably not a typo as both of those dict-keys are valid ("keys" means host keys, "pubkeys" means public key auth - this follows from older, regrettable IMO, naming conventions 😂 ) but I've just updated the changelog to be more explicit about the pubkey version of the config. (see c9a3409)
Thanks, disabled_algorithms={'pubkeys': ['rsa-sha2-256', 'rsa-sha2-512']} worked for me as well, hitting an old MINA implementation. ('keys' did not work for me either)
Hi @bitprophet, I got the same error and solved it by: client.connect("<hostname>", disabled_algorithms={'pubkeys': ['rsa-sha2-256', 'rsa-sha2-512']})
Then got error Unable to agree on a pubkey algorithm for signing a 'ssh-rsa' key! for other hosts. Can we have a general way for this situation? Ps: I have to downgrade to 2.7.2 to adapt all hosts o(╥﹏╥)o
Yea I'm not very happy with disabled_algorithms as-is, it was fine for the fix it came in with, but is proving unintuitive/complex at this point in time. There are a few other small backwards incompatible API changes in the pipeline that will likely accompany the drop of Python 2 support - I expect changing this would be included there.
Hi @bitprophet, I got the same error and solved it by: client.connect("<hostname>", disabled_algorithms={'pubkeys': ['rsa-sha2-256', 'rsa-sha2-512']})
Then got error Unable to agree on a pubkey algorithm for signing a 'ssh-rsa' key! for other hosts. Can we have a general way for this situation? Ps: I have to downgrade to 2.7.2 to adapt all hosts o(╥﹏╥)o
I solved that by associating hostnames to dictionaries of connection parameters similar to stanzas in an ~/.ssh/config file.
The changelog still says "Specifically, you need to specify disabled_algorithms={'keys': ['rsa-sha2-256', 'rsa-sha2-512']} in either SSHClient or Transport. See below for details on why."
Using "keys" and not "pubkeys". So I've had to rediscover the fix (after having put upgrading paramiko on hold for a couple weeks).
The changelog still says "Specifically, you need to specify disabled_algorithms={'keys': ['rsa-sha2-256', 'rsa-sha2-512']} in either SSHClient or Transport. See below for details on why."
Using "keys" and not "pubkeys". So I've had to rediscover the fix (after having put upgrading paramiko on hold for a couple weeks).
@justinpryzby Since you've been elbows-deep in understanding this, could you create a PR on the CHANGELOG with suitable edits?
In particular, are there some circumstances where you want to use keys and some where you want to use pubkeys? Or is it just a typo, and it should always be pubkeys?
On Tue, Aug 23, 2022 at 07:20:42AM -0700, Brian Skinn wrote:
How's this for improved language, @justinpryzby: #2104
| Specifically, you need to specify one or both of ``disabled_algorithms={'keys':
| ['rsa-sha2-256', 'rsa-sha2-512']}`` or ``disabled_algorithms={'pubkeys':
| ['rsa-sha2-256', 'rsa-sha2-512']}``in either `SSHClient
You can't actually specify both of:
disabled_algorithms={'keys': ['rsa-sha2-256', 'rsa-sha2-512']}
disabled_algorithms={'pubkeys': ['rsa-sha2-256', 'rsa-sha2-512']}
Rather, you'd specify
disabled_algorithms = dict(keys=['rsa-sha2-256', 'rsa-sha2-512'],
pubkeys=['rsa-sha2-256', 'rsa-sha2-512'])
Also, I think you're missing a space before "in either".
I wrote the review here since github's review editor is so poor that I couldn't
even use it to review a 3 line change..
And yea -- the 'add suggestion' feature works decently if everything that needs changing is on a single line, but it's pretty bad for suggestions on multiline chunks.
Activity
jun66j5 commentedon Feb 9, 2022
If the host is a legacy SSH server which doesn't support rsa-sha2-256/512 signatures, you need to use
disabled_algorithms={'keys': ['rsa-sha2-256', 'rsa-sha2-512']}to fix it.See https://www.paramiko.org/changelog.html#2.9.0
If the issue is not fixed even using
disabled_algorithms, please share the trace back of theAuthenticationError.vitali-r commentedon Feb 9, 2022
I have the same issue. Downgrading to
2.8.1helps. Downgrading to2.9.0does not help. Passingdisabled_algorithms={'keys': ['rsa-sha2-256', 'rsa-sha2-512']}does not helpjun66j5 commentedon Feb 9, 2022
vitali-r commentedon Feb 9, 2022
I don't know the version and am unable to check the logs as it is the remote client's server.
I figured out that commenting out these both two lines works for me:
vitali-r commentedon Feb 9, 2022
Looks like the issue is in filtering out keys. Investigating now.
jun66j5 commentedon Feb 9, 2022
Ah, I noticed https://www.paramiko.org/changelog.html#2.9.0 has typo about
disabled_algorithms....Please try to pass:
instead of:
vitali-r commentedon Feb 9, 2022
Yep it worked! Thank you!
bitprophet commentedon Feb 11, 2022
Good spot @jun66j5 - it's arguably not a typo as both of those dict-keys are valid ("keys" means host keys, "pubkeys" means public key auth - this follows from older, regrettable IMO, naming conventions 😂 ) but I've just updated the changelog to be more explicit about the pubkey version of the config. (see c9a3409)
marc-swingler commentedon Feb 13, 2022
Thanks, disabled_algorithms={'pubkeys': ['rsa-sha2-256', 'rsa-sha2-512']} worked for me as well, hitting an old MINA implementation. ('keys' did not work for me either)
realcp1018 commentedon Feb 16, 2022
Hi @bitprophet, I got the same error and solved it by:
client.connect("<hostname>", disabled_algorithms={'pubkeys': ['rsa-sha2-256', 'rsa-sha2-512']})Then got error
Unable to agree on a pubkey algorithm for signing a 'ssh-rsa' key!for other hosts. Can we have a general way for this situation?Ps: I have to downgrade to 2.7.2 to adapt all hosts o(╥﹏╥)o
ghostbody commentedon Feb 19, 2022
disabled_algorithmsis a very bad idea if you really need it for both version ...bitprophet commentedon Feb 25, 2022
Yea I'm not very happy with disabled_algorithms as-is, it was fine for the fix it came in with, but is proving unintuitive/complex at this point in time. There are a few other small backwards incompatible API changes in the pipeline that will likely accompany the drop of Python 2 support - I expect changing this would be included there.
marc-swingler commentedon Feb 25, 2022
@realcp1018
I solved that by associating hostnames to dictionaries of connection parameters similar to stanzas in an ~/.ssh/config file.
justinpryzby commentedon Aug 22, 2022
The changelog still says "Specifically, you need to specify disabled_algorithms={'keys': ['rsa-sha2-256', 'rsa-sha2-512']} in either SSHClient or Transport. See below for details on why."
Using "keys" and not "pubkeys". So I've had to rediscover the fix (after having put upgrading paramiko on hold for a couple weeks).
bskinn commentedon Aug 23, 2022
@justinpryzby Since you've been elbows-deep in understanding this, could you create a PR on the CHANGELOG with suitable edits?
In particular, are there some circumstances where you want to use
keysand some where you want to usepubkeys? Or is it just a typo, and it should always bepubkeys?justinpryzby commentedon Aug 23, 2022
I think I'm only ankles-deep -- I know that "pubkeys" is what works for our application, and for other people who had opened github issues.
But @bitprophet suggests that both keys are valid, and presumably some people will need "keys" (perhaps in addition to "pubkeys").
#1984 (comment)
bskinn commentedon Aug 23, 2022
How's this for improved language, @justinpryzby: #2104
justinpryzby commentedon Aug 23, 2022
Update disabled_algorithms language per review.
bskinn commentedon Aug 23, 2022
Good catches, all - thanks, @justinpryzby! See revised PR.
And yea -- the 'add suggestion' feature works decently if everything that needs changing is on a single line, but it's pretty bad for suggestions on multiline chunks.
backups: Fix issue with verifying SSH hosts with RSA key