Skip to content

Shell access

AWS SSM

By default, all EC2 instances are enrolled into AWS Systems Manager. You can use this feature with the Connect button inside the AWS Web Console to open up a (root) shell on the selected machine.

You can also use the local command line tooling to have a sort-of SSH replacement but using SSM.

If OpenSSH is provisioned on a target host, you can utilize SSM to set up a tunnel and connect to the SSH port via that. This also works on hosts that are in private networks and/or behind firewalls. This is the recommended way to use SSM.

Using the aws-ssm tool

If your solution is set up with the aws-ssm helper script, you can connect to instances directly:

aws-ssm <instance-id>

You could also use aws-ssm with the name of the instance(without prefix):

aws-ssm gitlab-rails-1