sshtunnel
sshtunnel copied to clipboard
Key passphrase is not used properly
Hi there, I am unable to use the open_tunnel function with a key and no ssh agent. Tested on linux mint 17.2 and 18.3, with sshtunnel version 0.1.3 and 0.1.4.
To reproduce, create ssh private/public keys with a passphrase. Then this for instance:
ssh_tunnel = open_tunnel('ssh_hostname',
ssh_username='user',
ssh_pkey='path/to/private/key',
ssh_private_key_password='secret',
allow_agent=False,
remote_bind_address=('127.0.0.1', 3306),
)
returns an error: "ValueError:
No password or public key available!"`
If I add the key to the ssh agent, then change allow_agent to True, the connection works.
I will try to investigate more the issue when I have a moment.
If you remove ssh_username
it should work.
I'm getting this same issue with key created using ssh-keygen
on Arch linux. Removing the ssh_username
doesn't help ...
I had this error.
It turns out I was passing in an invalid key. It wasn't -----BEGIN OPENSSH PRIVATE KEY-----...
.