0

I am trying to connect to a remote server using the sshtunnel module in python. but it keeps giving me the following error

ERROR | Password is required for key C:\Users\folder/.ssh\id_rsa

key_file = os.path.join('C:\\Users\\folder\\.ssh', 'id_rsa')

server = sshtunnel.SSHTunnelForwarder(
    ('remote_ip_address',22),
    ssh_username="user",
    ssh_pkey= key_file,
    ssh_private_key_password="password",
    remote_bind_address=('127.0.0.1', 3306),
    local_bind_address=('127.0.0.1', 3306)
)

Used to work just fine. Dont understand what has changed and why this is not working anymore.

1 Answers1

0

Could you please check id_rsa file?

in previous stackoverflow answers

(sshtunnel doesn't recognize private key password)

said -----BEGIN RSA PRIVATE KEY----- is need top of the rsa file (also need -----END RSA PRIVATE KEY----- end of the rsa file).

i have same problem, when i use bastion server aws ec2.

but in my case, i was wrong pkey. .pem type key is needed