AWS private EC2 instance SSH access

Access an EC2 Instance via SSH in a private VPC subnet

You want to check services running in a private subnet in your VPC on AWS, or just want to play around with the shell on a small instance on your private network? This guide shows you how to access an EC2 instance on a private subnet within your VPC via SSH:

  1. Launch an EC2 instance

2. Select Amazon Linux 2 AMI

3. Select the micro or nano instance type

4. Select the network in which the instance should run

5. Click review and launch

6. Ignore SSH Keys(proceed without a keypair)

7. Assign the SSM automation role to the instance

8. There is no role available — create a new IAM role

9. Select EC2 as trusted entity

10. Attach the AmazonSSMManagedInstanceCore Policy

11. Review the role and give it a name e.g. SSM_EC2_Access_Role

12. Attach the role to your EC2 instance

13. Start a session with the Systems Manager (check that you are using the same region as the instance!!!)

14. New Browser Tab opens and you’re ready to go

Finally, a small and inexpensive instance runs to test the connections of services on your private subnet.

Software Architect

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store