Last active
December 14, 2015 19:39
-
-
Save ferrouswheel/5138128 to your computer and use it in GitHub Desktop.
Want to tunnel your ssh connections through host A to get to host B?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Why would you do this? | |
# Well, perhaps you have a VPN to A, and A can access B but you can't access B directly. | |
# Assuming a and b are hosts in the domain example.com. Add the below to ~/.ssh/config on | |
# your local machine. | |
Host b.example.com | |
ProxyCommand ssh -q a.example.com nc -q0 b.example.com 22 | |
# If you have another host that only b can access, you can also chain through that! | |
Host c.example.com | |
ProxyCommand ssh -q b.example.com nc -q0 c.example.com 22 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment