A supported Linux EC2 instance in a private subnet runs the current SSM Agent. The node IAM role, operator session permissions, and required outbound HTTPS paths are prepared. Do not use a bastion or inbound TCP 22.
Store commands and output from a regular interactive shell in CloudWatch Logs. The log group, write permissions, and connectivity are prepared. SSH and port-forwarding sessions are outside the scope.
Which connection method and configuration meet the requirements?
Configure regular shell session logging and verify both connectivity without inbound SSH and actual command-and-output retention.
Detailed explanation
Connection or log-write permissions do not replace logging configuration. Check session preferences and actual delivery.
API activity and shell contents are different records. Session lifecycle events alone do not meet the command-and-output retention requirement.
Session Manager does not provide session-content logging for SSH connections. Distinguish its role as an SSH tunnel from regular shell logging.
Prepared Agent, IAM permissions, and outbound paths support a shell without inbound SSH. Verify commands and output at the configured destination; successful connectivity alone does not establish logging.
Check official documentation
Compare the following points with the official documentation.
On an approved test node, check Agent, IAM permissions, outbound HTTPS paths, and session preferences. Print an identifiable test string in a regular shell. Separately inspect commands and output in CloudWatch Logs and StartSession and TerminateSession in CloudTrail.
Official references
- Official documentation 1
- Official documentation 2
- Official documentation 3
- Official documentation 4
- Official documentation 5
- Official documentation 6
What to confirm
A regular shell connects without inbound TCP 22, and its test commands and output appear in the selected log group. Do not assume SSH or port-forwarding content logging, or infer shell-content retention from lifecycle events alone.
Key points
- Session Manager
- Session logging
- SSM Agent
Notes
- Environment: Official Systems Manager documentation and an approved Linux test node with IAM, connectivity, and CloudWatch Logs prepared
- Reviewed against the linked AWS documentation on 2026-10-14.
Foundation review
Check Agent, permissions, and outbound connectivity
Check supported OS and Agent, the node IAM role, and operator session permissions. Agent connects to Regional ssm and ssmmessages endpoints over HTTPS 443. A private node still needs routes and DNS through VPC endpoints or NAT. No inbound SSH requirement does not eliminate outbound connectivity. Prepare logging-destination permissions and paths separately.
Distinguish session types and content logging
A regular interactive shell can record commands and output in S3 or CloudWatch Logs according to session preferences. Enable recording for this scenario. Session Manager does not provide content logging for SSH or port-forwarding sessions; do not describe all session types as providing the same content records.
Compare API activity with delivered contents
CloudTrail StartSession and TerminateSession record API activity, not every shell command and output. Check connection success, logging settings, and actual delivery of the test string separately. If Linux logs are truncated, also check the documented screen utility requirement.