Skip to content
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

How can I pass an argument (disabled_algorithms) to the connection function of an instance of SSHClient in paramiko? #258

Open
murata100 opened this issue Apr 13, 2022 · 1 comment

Comments

@murata100
Copy link

murata100 commented Apr 13, 2022

The following code worked fine.
(If disabled_algorithms is not specified, AuthenticationException: Authentication failed.)

import paramiko
with paramiko.SSHClient() as ssh:
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    with open(PATH_OF_PKEY) as f:
        pk = paramiko.RSAKey.from_private_key(f)
        ssh.connect(
            HOST, PORT, SSHUSER, pkey=pk,
            disabled_algorithms=dict(pubkeys=['rsa-sha2-256', 'rsa-sha2-512']))

But the code below didn't work.

import sshtunnel
with sshtunnel.SSHTunnelForwarder(
        (HOST, PORT),
        ssh_username=SSHUSER,
        ssh_pkey=PATH_OF_PKEY,
        remote_bind_address=(MySQLHOST, MySQLPORT),
        disabled_algorithms=dict(pubkeys=['rsa-sha2-256', 'rsa-sha2-512'])
    ) as server:
    server.start()

I got ValueError

ValueError: Unknown arguments: {'disabled_algorithms': {'pubkeys': ['rsa-sha2-256', 'rsa-sha2-512']}}

How can I pass an argument (disabled_algorithms) to the connection function of an instance of SSHClient in paramiko?

@murata100
Copy link
Author

Here's why I need disabled_algorithms:
RSA key auth failing from paramiko 2.9.x client to dropbear server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant