ssh to remote servers via a proxy server 20 April 2017
In some strictly controlled hosts, ssh access is limitted from only a few hosts. For example, Server1 is not allowed to ssh to Server2, while Server0 does not has that limit. If we want to ssh to Server2 from Server1, we will have to use Server0 as a proxy server.
In newer SSH versions, we could use -J
option as below:
In older versions, -J
is not available. In this case, we could use ProxyCommand along with the -W
option as below:
For more detail, check this wiki.
When programming in python with paramiko, here is some example code to use ProxyCommand.
本文出自夜惊心的博客,转载请保留出处blog comments powered by Disqus