SSH to servers behind JumpServers

Let’s suppose you have received a bunch of Linux servers you need now to administer… the problem tough, is that to access those servers you need to open a ssh session to a “Jump Server”, then from jump server, you will reach all the needed servers…

This is what I did:


1. ssh public keys installed on the jump server, and also in all the other servers…
Note: Although you really don’t need the keys for this approach to work, it’s very recommended… BTW who still using passwords??

To configure in your linux machine:

1. If not created, create a file named “config” under your user .ssh directory, and put the following contents…

vim /home/username/.ssh/config

and copy this contents:

Host host_you_need_to_connect_to
	ProtocolKeepAlives 15
	ServerAliveInterval 15
	ProxyCommand ssh -e none user@jumpserver exec nc %h %p

Quick explanation:

Host: In this option you configure the hostname or hosts names you want to connect to. The * it’s also useful. Example: server_*

Alive Options: This will keep you out of errors like this: Write failed: Broken pipe

ProxyCommand: This is where the magic happens, first it will open a ssh connection to the jump server, and execute netcat command to second server, or better to say to the host you want to connect to….


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s