I want to access to a private host from my local client.
How can I use sshtunnel and paramiko to run the following ssh commands in this order:
ssh userA@hostA -i key_file -L 5434:localhost:9876 # local port forwarding from port 5434 to hostA:9876 and ssh to hostA as userA
ssh userA@hostB # ssh from hostA to hostB as userA
I try to use sshtunnel.SSHTunnelForwarder and paramiko.SSHClient but I can't get it working. Hope I can get some advice. Thanks.
I want to access to a private host from my local client. How can I use sshtunnel and paramiko to run the following ssh commands in this order: ssh userA@hostA -i key_file -L 5434:localhost:9876 # local port forwarding from port 5434 to hostA:9876 and ssh to hostA as userA ssh userA@hostB # ssh from hostA to hostB as userA
I try to use sshtunnel.SSHTunnelForwarder and paramiko.SSHClient but I can't get it working. Hope I can get some advice. Thanks.