Create AWS SSH Tunneling with Amazon EC2

I think this is one of lots of questions that is being asked around. How to connect to the private subnet from local laptop?

The answers are 3 approaches:

  1. Connect via Bastion Host
    1. You can use EC2 instance as jumpbox to connect to your private subnet resources.
    2. You can use AWS System Manager Session Manager to connect to your private subnet resources.
  2. Connect via Tunneling
    1. You can use SSH tunneling from EC2 instance = https://binx.io/blog/2018/11/21/aws-ssh-tunneling/
      example: $ ssh -N -L8080:ip-10-0-1-92.eu-west-1.compute.internal:80 -i bastion.pem ec2-user@ec2-34-254-194-35.eu-west-1.compute.amazonaws.com
    2. You can use AWS System Manager Session Manager port forwarding to connect to private resources = https://aws.amazon.com/blogs/aws/new-port-forwarding-using-aws-system-manager-sessions-manager/
  3. Connect via VPN
    1. Use highly reliable and scalable Site to Site VPN from AWS Managed VPN Services
    2. Use Use highly reliable and scalable AWS Client VPN Services
    3. Deploy a 3rd party VPN Server at AWS Environment

Hope it is useful.

Best,
Doddi

Leave a Reply