Run Command: run a shell command on your instances
Run df -h, free -m or any command on managed EC2 instances through Systems Manager, follow it live and read the output.
Open Services → Systems Manager → Run Command, or an EC2 instance's More → Run command (it's picked for you).

- Pick instances. The list shows each managed instance's ping status, platform and SSM agent version. Instances whose agent isn't connected can't be picked.
- Type the commands, one per line, or tap a snippet: Disk (
df -h), Memory (free -m), Uptime, Service status (systemctl status <service>: replace the placeholder), top processes, recent errors. Windows instances get PowerShell snippets andAWS-RunPowerShellScript; Linux onesAWS-RunShellScript. - Run. It's a Pro action and goes through your guardrail. On an account whose name looks like production (prod, production, live), you always type the account name to confirm.
The command's screen updates every few seconds until every instance has finished, then shows each one's exit code, output and errors. The API keeps the first 24,000 characters of each; for more, the command needs an S3 bucket or CloudWatch Logs output, which the screen links to when set. Recent commands lists the last ones, with their results.
Instances that aren't managed
Running EC2 instances missing from Systems Manager are listed with the likely reason: No instance profile (attach a role with AmazonSSMManagedInstanceCore) or SSM agent not connected (the role lacks that policy, the agent is stopped, or the instance can't reach the SSM endpoints through the internet or VPC endpoints).
Permissions
| What | IAM actions | In ReadOnlyAccess / ViewOnlyAccess |
|---|---|---|
| Managed instances | ssm:DescribeInstanceInformation (and ec2:DescribeInstances for the unmanaged list) | Yes / No (add it) |
| Recent commands, status and output | ssm:ListCommands, ssm:ListCommandInvocations, ssm:GetCommandInvocation | Yes / No (add them) |
| Run | ssm:SendCommand on the document and the instances | No / No |
Questions
Does it open a shell session?
No. Run Command sends the commands and returns their output; nothing stays open. For an interactive session use Copy SSM session command on the instance and run it on your computer.
Email [email protected] with what you tried and any message the app showed. Don’t send access keys or secrets. We reply within two working days.