/ Published in: Bash
- You want to make use of the ProxyCommand option of ssh. Here is an example that uses one machine to connect to another.
- You can add the following to your ~/.ssh/config file.
- Host viatunnel
- IdentityFile ~/.ssh/inside_server_rsa
- ProxyCommand ssh -i ~/.ssh/proxy_server_rsa firstname.lastname@example.org "nc inside.mynetwork 22"
- user myself
- This will connect first to email@example.com and use that to make a connection to firstname.lastname@example.org
- Now typing: ssh viatunnel will connect using this configuration.
- The ProxyCommand line basically runs 'nc' on the first hop of your connection and establishes a tunnel to port 22 on the second server. Then the outside ssh uses that to connect.
- See ProxyCommand here at the openssh manual
You need to login to post a comment.