ssh ProxyCommand : Connect to a Host through an other

With ssh you can jump host using ProxyCommand. Some times you can only access a remote server via ssh by first login into an intermediary server (or firewall/jump host). So you first login into to the intermediary server and then ssh to another server.

Once you’ve opened a firewall session (see : external ssh access), you can connect to sismo’s host.
With usual way, you have to use two ssh connection.
With ssh ProxyCommand you can connect directly to a remote host.

Usual connection process to you host

Connection way with ssh ProxyCommand

For that you just have to add the followings line to your ~/.ssh/config file.

old way with netcat

moi@machinexterne:~/$ cat ~/.ssh/config
HOST *.sismo
User loginsismo
Port 22
ProxyCommand ssh 127.0.0.1 -p 11237 "nc `basename %h .sismo` %p"
moi@machinexterne:~/$

new way with OpenSSH 5.4 that come with netcat mode

moi@machinexterne:~/$ cat ~/.ssh/config
HOST *.sismo

# this 2 values are only use for the second part of the ssh
User loginsismo 
Port 22

ProxyCommand ssh loginsismo@127.0.0.1 -p 11237 -W `basename %h .sismo`:%p
moi@machinexterne:~/$

Usage

Then to connect for exemple to datte host, you just have to do this (if you have ssh key and agent configured).

moi@machinexterne:~/$ ssh datte.sismo
loginsismo@datte %

See ssh-keys documentation.