SSH Through a Jumpbox using config files¶
We will be using 3 machines for this exercise: - Your Workstation - Jumpbox - Server
Prerequisites¶
Verify if we can ssh from your workstation to the jumpbox (server2), and then from the jumpbox to the server. This will create the .ssh directory at the same time
Rename the VMs for simplicity¶
On each VM rename them to match workstation, server1, server2
SSH Config¶
Jumpbox ssh configuration¶
Create or edit the SSH config file on your workstation
Add the following lines
example:From your workstation, test the new configuration
Server ssh configuration¶
Modify the ssh config file on your workstation again
Add the information to SSH to the server in the private subnet. This time we're going to add the extra ProxyJump attribute
Host {server connction name}
HostName {server ip address}
User {server username}
ProxyJump {jumpbox}
example:
Now you can connect to a server easily through a jumpbox without needing to specify anything