[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ssh connection via a proxy
[Thread Prev] | [Thread Next]
[Date Prev] | [Date Next]
- Subject: ssh connection via a proxy
- From: Jeremy Fix <Jeremy.Fix@xxxxxxxxxxxxxxxxxx>
- Reply-to: Jeremy.Fix@xxxxxxxxxxxxxxxxxx
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 2 Aug 2021 23:28:10 +0200
- To: libssh@xxxxxxxxxx
Hello, I would like to use libssh for connecting to a remote host via a gateway, executing a command on the remote host and parsing its standard outputs/errors; So the picture is localhost -> gateway -> remote I'm pretty new with libssh. I used to do that with command line ssh by specifying ssh -o ProxyCommand='ssh -W %h:%p mylogin@gateway' mylogin@remote mycommand It is not obvious to me how to do that with libssh; One track I have in mind is a variant of the above with : ssh -L 9999:remote:22 mylogin@gateway ssh -p 9999 mylogin@localhost mycommand therefore I would establish a tunnel then create a new libssh session on localhost and execute the command in a channel on this new session. I'm wondering if this is the right track to follow from implementing in libssh this bounce over a proxy. Thank you for your help. Jeremy.
Re: ssh connection via a proxy | Andreas Schneider <asn@xxxxxxxxxxxxxx> |