How to Connect to an EC2 Instance with SSM
Khang Tran
Posted on August 30, 2024
Launch an EC2 instance. (Preferably with an AMI using Amazon Linux 2023 or later)
Create an IAM role, and attach the policy "AmazonSSMManagedInstanceCore"
Attach the role to your EC2 instance
Go to your instance, click "connect" and choose "Session Manager"
The benefits of connecting to your EC2 instance through Session Manager is that doesn't require you to open any ports to connect. This reduces the attack surface of your systems providing more security to your network.
Tip: After you created your EC2 instance, you can check if it has the SSM agent installed by connecting with Direct Connect first and then running the command
sudo systemctl status amazon-ssm-agent
You should get an output like this
Posted on August 30, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 27, 2024