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

BUG: allow_agent isn't working. #281

Open
ItamarIn opened this issue Jun 20, 2023 · 1 comment
Open

BUG: allow_agent isn't working. #281

ItamarIn opened this issue Jun 20, 2023 · 1 comment

Comments

@ItamarIn
Copy link

When I passed allow_agent=False to SSHTunnelForwarder object it still trying to connect using ssh keys.
even the documentation said it will pass look_for_keys=False

output:

17:01:17.620 | Connected (version 2.0, client OpenSSH_for_Windows_8.9)
17:01:17.777 | Authentication (publickey) failed.
17:01:17.820 | Connected (version 2.0, client OpenSSH_for_Windows_8.9)
17:01:17.971 | Authentication (publickey) failed.
17:01:18.015 | Connected (version 2.0, client OpenSSH_for_Windows_8.9)
17:01:18.173 | Authentication (password) successful!

version: 0.4.0

@cosimo
Copy link

cosimo commented Oct 17, 2023

A workaround, in case other people stumble on this, can be:

import paramiko

server = SSHTunnelForwarder(
    remote_host,
    # https://stackoverflow.com/questions/54213831/paramiko-or-sshtunnel-and-ssh-agent-without-entering-passphrase
    ssh_pkey=paramiko.agent.Agent().get_keys(),
    ...       
)

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

No branches or pull requests

3 participants