Skip to main content

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

  1. Add a new SSH profile in Settings for the bastion host.
  2. In the Advanced tab of the profile enable Agent forwarding.
  3. Add another SSH profile for the private server.
  4. Select the connection type as jump host.
  5. In the Jump Host dropdown select the bastion host.
  6. Connect to the private server.

🔗 Download link

Using Termius

Note

This feature requires the premium version of Termius.

  1. Add a new host. This will be the bastion host.
  2. Add a second host. This will be the private server.
  3. Enable the SSH Agent forwarding option in the second host.
  4. Click Edit Chain and add the bastion host.

🔗 Download link

Using CLI

tip

Use Bash on Windows

  1. Start the SSH agent

    eval "$(ssh-agent -s)"
  2. Add identities to ssh agent.

    ssh-add /path/to/keyfile1.pem
  3. SSH into the bastion host.

    ssh -A -i /path/to/keyfile2.pem <user>@<server-ip>
  4. SSH into the required server from the bastion host.

    ssh <user>@<server-ip>
Note

Keyfile used in steps 1 and 2 can be different.