How to Provide SSH Access to a Private EC2 Instance Without Internet Exposure?
A company has a VPC that contains a public subnet and a private subnet. The company deploys an Amazon EC2 instance that uses an Amazon Linux Amazon Machine Image (AMI) and has the AWS Systems Manager Agent (SSM Agent) installed in the private subnet. The EC2 instance is in a security group that allows only outbound traffic. A CloudOps engineer needs to give a group of privileged administrators the ability to connect to the instance through SSH without exposing the instance to the internet. Which solution will meet this requirement?
Community Insight
It tests private-subnet SSH connectivity via an EC2 Instance Connect Endpoint; the trap is assuming the installed SSM Agent automatically makes a Systems Manager endpoint an SSH solution.
This question tests how to provide SSH access to a private EC2 instance without an internet gateway by using an EC2 Instance Connect endpoint. The page establishes that the endpoint must be created in the private subnet and that administrators need the right IAM permissions, making option A correct.
Many candidates choose B because the SSM Agent is present, but a Systems Manager endpoint alone is not an SSH gateway and the option omits the instance role required for Session Manager.
Community Discussion (2 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Option A is correct because an EC2 Instance Connect Endpoint is purpose-built to reach instances in private subnets without a public IP, internet gateway, or bastion host. The endpoint must be placed in the private subnet, and the instance security group must allow inbound SSH from the endpoint's security group so the tunnel can reach port 22. Administrators also need IAM permission to open the tunnel, and PowerUserAccess is broad but includes the relevant EC2 Instance Connect actions. The instance stays private because the SSH path is through the endpoint, not the internet.Why the Other Options Are Wrong
Option B fails because a Systems Manager endpoint is for SSM Agent control-plane traffic, not a general SSH gateway; Session Manager also does not require opening inbound SSH from the private network. The option omits the instance IAM role that would be needed for SSM registration, such as AmazonSSMManagedInstanceCore. Option C places the EC2 Instance Connect endpoint in the public subnet and uses a vague private-network SSH source, which does not match the endpoint security group pattern. Option D gets the instance role right but puts the SSM endpoint in the public subnet and gives administrators only AmazonEC2ReadOnlyAccess, which cannot start a session or open a tunnel.Community Comment Notes
Commenter emupsx1 selected A and observed that option D 'must be modified to' add SSM VPC endpoints and an instance role, which correctly spots D's missing instance-side pieces. Commenter Bad_Mat argued 'The correct choice is B' by describing an SSM endpoint as the SSH path, but that explanation does not resolve the absent instance profile or the unnecessary inbound SSH rule. The split highlights the intended distractor: the SSM Agent in the prompt makes Systems Manager feel relevant, while the explicit SSH requirement points to EC2 Instance Connect Endpoint.Official Reference
Exam Strategy
Read the access method literally: if the requirement says SSH and no internet exposure, look for EC2 Instance Connect Endpoint in the private subnet, not SSM Session Manager. Verify each option supplies both the administrator-side permissions and the correct endpoint placement before choosing.
Frequently Asked Questions
Why is option B wrong when the EC2 instance already has the SSM Agent installed?
SSM Agent enables Session Manager only with an instance profile and private SSM endpoints; option B omits the role and opens inbound SSH unnecessarily.
Does the EC2 Instance Connect endpoint need to be in the private subnet?
Yes for this design: placing it in the private subnet lets administrators reach the private instance through the endpoint without an internet gateway or public IP.
Related Analysis
Practice All SOA-C03 Questions
Access 100 questions with complete answers and detailed explanations.
View Full SOA-C03 Practice Test →