SSHing into servers in the private subnet
This guide describe how to ssh into servers which are in private subnet. We will use a bastion host as a tunnel to SSH into the server in private subnet.
Using Tabby
- Add a new SSH profile in Settings for the bastion host.
- In the Advanced tab of the profile enable Agent forwarding.
- Add another SSH profile for the private server.
- Select the connection type as jump host.
- In the Jump Host dropdown select the bastion host.
- Connect to the private server.
Using Termius
Note
This feature requires the premium version of Termius.
- Add a new host. This will be the bastion host.
- Add a second host. This will be the private server.
- Enable the SSH Agent forwarding option in the second host.
- Click Edit Chain and add the bastion host.
Using CLI
tip
Use Bash on Windows
Start the SSH agent
eval "$(ssh-agent -s)"
Add identities to ssh agent.
ssh-add /path/to/keyfile1.pem
SSH into the bastion host.
ssh -A -i /path/to/keyfile2.pem <user>@<server-ip>
SSH into the required server from the bastion host.
ssh <user>@<server-ip>
Note
Keyfile used in steps 1 and 2 can be different.