Session Manager Without Open Ports
Reach instances through SSM with no inbound access at all.
Session Manager Without Open Ports is a free AWS Security Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Shell Access, No Doors
Session Manager, a capability of AWS Systems Manager (SSM), gives you interactive shell access to EC2 instances and on-premises servers without opening any inbound ports. Understanding precisely how it achieves this is a high-value exam topic, because it underpins modern, bastion-free administration.
The SSM Agent
The magic starts with the SSM Agent, software preinstalled on most AWS AMIs (Amazon Machine Images). The agent runs on the instance and initiates an outbound connection to the Systems Manager service endpoints. Because the instance reaches out, no inbound rule is ever required, the security group can block all inbound traffic.
The Instance Role
For SSM to work, the instance needs an IAM role (via its instance profile) granting Systems Manager permissions, typically the managed policy AmazonSSMManagedInstanceCore. Without this role the agent cannot register, so attaching the right role is the first troubleshooting step when an instance does not appear as a managed node.
arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCoreNo Public IP Needed
Session Manager works even for instances in private subnets with no public IP. The agent reaches SSM either through a NAT gateway or, more securely, through VPC interface endpoints (PrivateLink) for ssm, ssmmessages, and ec2messages. Endpoints keep all traffic on the AWS network, never touching the internet.
Starting a Session
An authorized user starts a session from the console, CLI, or SDK. The command below opens a shell on a managed instance with no SSH client, key, or open port involved. IAM decides whether the user may start the session at all.
aws ssm start-session --target i-0abcd1234efgh5678IAM Controls Access
Who can open a session is governed entirely by IAM policies on the ssm:StartSession action. You can scope access to specific instances by tag, restrict which users may connect, and even limit which SSM documents (session types) they may use. This replaces SSH key distribution with centralized, auditable IAM control.
Tag-Based Restrictions
A powerful pattern scopes session access by instance tag. A policy can allow ssm:StartSession only on instances tagged, say, Environment=Dev, so developers reach dev boxes but never production. This attribute-based control scales cleanly and enforces least privilege without per-instance policies.
Encrypted in Transit
Session data is encrypted in transit using TLS, and you can require KMS encryption for the session channel for extra assurance. Combined with no open ports, this means administrative traffic is both invisible to the internet and protected end to end, satisfying strict compliance requirements.
Port Forwarding
Session Manager also supports port forwarding, tunneling a port from your machine to a port on the instance (or beyond) over the secure SSM channel. This lets you reach RDP or a database without exposing those ports publicly, replacing yet another reason teams kept bastions around.
Why It Is Secure
The security model is compelling: no inbound ports to attack, no SSH keys to leak, IAM-based access control, optional private endpoints, and encryption throughout. Every weakness of traditional remote access is addressed, which is why the exam treats Session Manager as the default answer for secure administration.
Putting It Together
Session Manager uses an outbound SSM Agent plus an instance role with AmazonSSMManagedInstanceCore to deliver shell access with no inbound ports, public IP, or keys. Access is controlled by IAM (ssm:StartSession), scoped by tags, encrypted in transit, and reachable privately through VPC endpoints. It also supports secure port forwarding.
Quick Check
Test Session Manager mechanics.
Recap
Session Manager gives shell access through the outbound SSM Agent plus an instance role (AmazonSSMManagedInstanceCore), needing no inbound ports, public IP, or keys. Access is governed by IAM (ssm:StartSession), scoped by tags, encrypted with TLS/KMS, and works privately via VPC endpoints for ssm, ssmmessages, and ec2messages. It also supports secure port forwarding.
Frequently asked questions
Is the “Session Manager Without Open Ports” lesson free?
Yes — the full text of “Session Manager Without Open Ports” is free to read here on the web, and the AWS Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Security Academy course, upgrade to CoddyKit PRO.
What will I learn in “Session Manager Without Open Ports”?
Reach instances through SSM with no inbound access at all. You practise AWS Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start AWS Security Academy?
No prior experience is required. AWS Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Session Manager Without Open Ports” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this AWS Security Academy lesson?
Yes. Every AWS Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Why Bastion Hosts Add Risk
- Session Manager Without Open Ports
- Auditing and Logging Admin Sessions
- Hardening Endpoints and Patch Manager