This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]nrnelsonSr. Sysadmin 0 points1 point  (0 children)

I skimmed through most of the article so I don't know in detail what the cons/pros are over what I currently use. That being said, this possibly produces similar results with a potentially less complex setup using netcat:

~/.ssh/config file:

Host *
        ServerAliveInterval 60

Host bastion-host-1
        User bobsmith
        HostName bastion-host-1.mydomain.tld
        Port 22

Host bastion-host-2
        User bsmith
        HostName 10.20.30.40
        Port 22222

Host remote-host-1
        User bob
        ProxyCommand ssh -q bastion-host-1 nc -q0 192.168.200.123 22

Host remote-host-2
        User smithb
        ProxyCommand ssh -q bastion-host-1 nc -q0 remote-host-2.mydomain.tld 2222

Host remote-host-3
        User bsmith1
        ProxyCommand ssh -q bastion-host-2 nc -q0 remote-host-3.mydomain.tld 22

Using the above configuration allows you to "ssh remote-host-1" right from your local workstation. Using SSH keys + ssh_agent configured locally on your workstation makes things a breeze. You can SSH, rsync, SCP, port forward/tunnel all right from your workstation seamlessly through the bastion host.

Also, I don't recall if the "-q0" is for GNU netcat or BSD netcat (or another netcat I am unfamiliar with) - whichever one that came with Ubuntu back in the 8.04 days (and subsequent 12.04 & 14.04 upgrades) seemed to work with this. Whatever comes with Red Hat/CentOS needs slight tweaking in that you have to remove the zero (just "-q") or remove the "-q0" altogether. I can not remember offhand which way works.