SSH to a machine behind firewall

(This post is mostly for myself, because I know I’ll forget the exact syntax next I need it)

I’ve recently discovered that instead of ssh to one machine and then ssh to another machine in the local network, I can configure ssh to start the proxy connection automatically.  For example:

Host example-local-10
    HostName 192.168.0.10
    ProxyCommand ssh example.com nc %h %p 2> /dev/null

Especially useful when working with various tools that just use the ssh transport protocol, like scp or rsync.

This entry was posted in Tools and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>