title: “AWS Systems Manager Session Manager” created: 2026-07-20 updated: 2026-07-20 type: knowledge tags:
- aws
- ssm
- ec2
- devops
- security
- certification
AWS Systems Manager Session Manager
What It Is
Session Manager is a capability of AWS Systems Manager that lets you open a secure shell session to an EC2 instance without opening inbound ports (SSH/22), managing bastion hosts, or distributing SSH keys.
Why It Matters
Session Manager is the AWS-recommended way to access EC2 instances interactively. It eliminates common attack vectors (exposed SSH ports) and provides full audit logging. Frequently tested as the secure alternative to SSH.
Key Concepts
How It Works
User (Console/CLI) → HTTPS (443) → SSM Agent on EC2 → Shell session
- The EC2 instance runs the SSM Agent (pre-installed on Amazon Linux 2, Ubuntu, Windows AMIs)
- The agent communicates outbound to the SSM service over HTTPS (port 443)
- No inbound security group rules needed — no port 22 exposure
- User initiates session from Console or CLI:
aws ssm start-session --target i-xxxxx
Prerequisites
| Requirement | Detail |
|---|---|
| SSM Agent | Must be installed and running on the instance |
| IAM Role | Instance needs a role with AmazonSSMManagedInstanceCore policy |
| Network | Outbound HTTPS (443) to SSM endpoints (or VPC endpoint) |
| No SSH key needed | Authentication is handled via IAM |
Security Benefits
- No open inbound ports — security groups can deny all inbound traffic
- No SSH keys to manage — access controlled via IAM policies
- Full audit trail — sessions logged to CloudTrail, optionally to S3/CloudWatch
- Session recording — can capture all commands and output
- IAM-based access control — fine-grained who-can-connect-to-what
Connecting via Console
- EC2 → Instances → select instance → Connect
- Choose Session Manager tab
- Click Connect → browser-based shell opens
Gotchas
- Instance must have outbound internet or a VPC endpoint for
ssm,ssmmessages, andec2messages - If the SSM Agent is stopped or the IAM role is missing, the instance won’t appear as “managed”
- Session Manager works with private instances (no public IP needed)
- Default shell is
sh; configure in SSM preferences forbash
See Also
- [[iam-instance-profiles]]
- [[aws-cli-s3-commands]]