ssh proxy

A cool feature of ssh config is to use a proxy to ssh to another host.

In this example I have connected a pi to a another pi:

 

.ssh/config

Host proxypi 192.168.1.1
    HostName 192.168.1.1
    User pi
    UserKnownHostsFile /dev/null
    StrictHostKeyChecking no
    IdentityFile ~/.ssh/id_rsa.pi

Host pi2 169.254.1.1
    HostName 169.254.1.1
    User pi
    UserKnownHostsFile /dev/null
    StrictHostKeyChecking no
    IdentityFile ~/.ssh/id_rsa.pi2
    ProxyCommand ssh -F ~/.ssh/config proxypi nc %h %p
This entry was posted in ssh and tagged . Bookmark the permalink.