"You need a bastion host to reach private servers." Not anymore. A bastion works, but it's one more server to patch, with a port open to the internet and a pile of SSH keys to look after. Session Manager, part of AWS Systems Manager, gives you a shell on a private server with no inbound ports open at all.
How a bastion host works
A bastion host (or jump box) is a small server in a public subnet. You connect to it with SSH, and from there you jump to the servers in your private subnets, which accept SSH only from the bastion.
It's a simple pattern, and it comes with permanent chores:
- A port open to the internet. Port 22 has to be reachable, ideally only from known IP addresses. Anything listening on the internet gets scanned constantly.
- SSH keys. Someone has to hand them out, rotate them, and remove them when people leave. A shared key means you can't tell who did what.
- Patching and cost. The bastion must be updated, monitored and paid for, and if it's down, nobody gets in.
How Session Manager works
With Session Manager you start a session from the AWS console or the AWS CLI and get an interactive shell on the instance (PowerShell on Windows).
The connection is built the other way round. The SSM Agent running on the server makes an outbound HTTPS connection to the Systems Manager service, and your session travels through that channel. So:
- The server needs no inbound ports: no port 22, no public IP address, no bastion.
- There are no SSH keys to manage.
What the server needs
- The SSM Agent, installed and running. Many AWS-provided images, such as Amazon Linux, include it.
- An IAM role attached to the instance that allows it to talk to Systems Manager. AWS provides the managed policy
AmazonSSMManagedInstanceCorefor this. - A network path out to the Systems Manager endpoints over HTTPS: through a NAT gateway, or through VPC interface endpoints if the subnet has no internet access at all.
If an instance doesn't appear in Session Manager, check these three first.
Access and audit through IAM
Who can connect is decided by IAM policies, not by who holds a key. You can allow a team to open sessions only on instances with a certain tag, and remove someone's access in one place.
Every session start is recorded in AWS CloudTrail, and you can send session activity to Amazon S3 or CloudWatch Logs to keep a record of what was typed. One caveat from the AWS documentation: that session logging isn't available when you use Session Manager for port forwarding or to tunnel SSH.
When a bastion still makes sense
A bastion may still be right for tools that only speak plain SSH and can't use the Session Manager plugin, or for servers where you can't install the agent. AWS also offers EC2 Instance Connect Endpoint, another way to reach instances that have no public IP address without running a bastion.
Where AI fits
GPU servers for training and inference are among the most expensive things you can run on AWS, and the models and data on them are valuable. That makes them attractive targets.
With Session Manager, those servers can sit in private subnets with zero inbound ports and no public IP addresses. Engineers still get a shell to debug a training job, access is tied to their IAM identity, and sessions are logged.
Quick recap
- A bastion needs an open port, SSH keys and constant patching.
- Session Manager needs the SSM Agent, an IAM role and an outbound HTTPS path.
- No inbound ports, access controlled by IAM, sessions logged.
- Keep expensive GPU servers private and reach them through Session Manager.