Set up EC2 Instance Access via Bastion/Jump Host using Putty

Nordmeyer
2 min readMay 7, 2021

--

[Update: I am using MobaXterm now, it’s more convenient than Putty]

I am using Putty from a windows system to jump over a bastion host to an AWS EC2 Linux server.

What we need

  • the target Linux server having AWS internal IP 99.99.99.99 in my example
  • the jump host, having public IP 1.1.1.1 in my example
  • AWS authentication key in file target-linux-server-keypair.ppk

When we are done we will (1) start the bastion host connection with tunnels. Using one of these tunnels we (2) connect the target server in a second step.

Configure Bastion tunnels:

Session 1: Bastion

  • open Putty
  • create [Session] configuration to access the bastion host. Don’t forget to save it for later use.
  • go to [Connection-SSH-Tunnels]. There enter the tunnel port (e.g. 2291) and the destination (99.99.99.99:22). After clicking [add] the tunnel config will be listed in the white frame below [remove] button.
    If you want to jump to other servers via the same bastion host you should add the addresses here, too. Just assign different source ports
  • upload your authentication key file in form [Connection-SSH-Auth]
  • return to [Session] and save configuration

Session 2: Target server via tunnel

  • create a second [Session] targeting localhost on port 2291

Use it

To run the the server access via bastion host, you have to start (1) the bastion ssh connection (with tunnels) first and afterwards (2) the ssh connection to the target server.

--

--

No responses yet