"You can't audit what people do on a server." With shared SSH keys, that's often true: five engineers use the same key, the server log shows one user name, and nobody recorded the commands. AWS Systems Manager Session Manager changes that. Access is decided by IAM, every session has a name attached to it, and the session itself can be recorded.
What Session Manager is
Session Manager is a tool in AWS Systems Manager that opens an interactive shell (bash or PowerShell) on a managed node: an EC2 instance, an on-premises server, a VM or an edge device. You start it from the Systems Manager console, the EC2 console or the AWS CLI (with the Session Manager plugin). The SSM Agent on the server calls out to AWS, so you need no inbound ports, no bastion host and no SSH keys. We compared it with a jump box in Bastion hosts vs Session Manager; this post is about the audit side.
IAM decides who gets in
Access is an IAM policy, not a key on a server. You can say "this group of engineers may start sessions only on instances tagged env=prod", or grant on-call engineers access only for their rotation. Remove the permission and access ends everywhere at once; there is no key to hunt down on fifty servers. Session documents can go further and limit a session to a single command.
Every session leaves a trail
- AWS CloudTrail records the API calls: who started a session, on which node, and when.
- Session logging can stream what was typed and printed to an S3 bucket or a CloudWatch Logs log group, optionally encrypted with your KMS key.
- Amazon EventBridge can react when a session starts or ends, for example sending an SNS message when someone opens a shell on production.
One limit people miss: session data is not logged for port forwarding or SSH-over-Session-Manager sessions, because the traffic is encrypted end to end inside the tunnel. CloudTrail still shows that the session happened.
Port forwarding
Session Manager can forward a local port to a port on the node, or through the node to a private host, such as a database in a private subnet. It's a clean way to run a database client from your laptop without exposing the database, but remember the logging limit above.
A common mistake is turning on Session Manager and forgetting the instance role (or Default Host Management Configuration) and, in private subnets, the Systems Manager VPC endpoints. Without them the node never shows up as managed. Note too that the old standalone Session Manager console page is being retired at the end of 2026 in favour of the unified Systems Manager console; the feature itself stays.
Where AI fits
AI agents that operate infrastructure sometimes need a shell. Don't give them an SSH key. Give the agent its own IAM role, allowed to start sessions only on the servers it should touch (by tag), ideally with a session document that limits what it can run. There is no key to leak, you can revoke it in one place, and its sessions are logged exactly like a human's, so you can review what it did.
Quick recap
- IAM decides who can open a session, on which servers.
- Sessions are recorded in S3 or CloudWatch Logs; CloudTrail records who and when.
- No keys, no open ports, and the same rules apply to AI agents.