[clug] Cool ssh hack

Michael Still mikal at stillhq.com
Sat Jun 9 23:16:04 MDT 2012


I saw this recently, and its super cool. Perhaps other people would find
it useful. I have many machines at home, and a single ssh jumphost which
has external DNS and a routable IP. Here's how I can ssh to an internal
machine called zii.home.stillhq.com or another machine named
cat.home.stillhq.com by magic wherever I may be...

$ cat ~/.ssh/config
Host cat.home zii.home
  ProxyCommand ssh jumphost.stillhq.com nc -q0 %h %p

So, when I ssh to zii.home.stillhq.com, ssh actually connects to
jumphost.stillhq.com. It then runs netcat, and pushes ssh traffic to it.
So, there are two ssh authentications, but because I use key based
authentication I don't even notice.

I figured maybe this might be useful to others?

Mikal


More information about the linux mailing list