Loading Posts...

How To Access EC2 Instances With AWS Systems Manager (SSM), Session Manager

I hope everyone knows how to access an EC2 instance with a “keypair” and, lets see how we can access an EC2 instances with AWS Systems Manager, Session Manager option. This is really easy when you have access to the AWS console and, you don’t need to grab your keys and open up a ssh session using a client software. AWS itself provides a web console itself to access the running instances. By default all instances are not enabled with this service and, special roles and policies should be attached to the instances.

If you access the Session Manager under, Systems Manager you cannot see any instance in the console.

access an EC2 instances with AWS Systems Manager no instances

Read. More:

Adding “AmazonEC2RoleforSSM” Policy

EC2 instances are normally allowing to access the AWS services using a role and, policies should be attached to the role. In order to enable the access to instances, “AmazonEC2RoleforSSM” should be attached.

access an EC2 instances with AWS Systems Manager Policy

If you don’t have a role created make sure to create a role with this policy attached.

access an EC2 instances with AWS Systems Manager role

After couple of minutes login to the AWS Systems Manager and, access the Session Manager. Instance will be listed and, select the instance and start the Session.

access an EC2 instances with AWS Systems Manager instance listed

It will open up an another tab with a connection to the instance, you can now run the commands directly from the console. This session will be loaded with the “ssm-user” which is a part of “sudoers”. Here is my instance. output with few commands.

access an EC2 instances with AWS Systems Manager connection

Session can be terminated with the “Terminate” button at the top. I hope, this is quite useful when need to access EC2 instances.

Click to rate this post!
[Total: 4 Average: 5]

Aruna Lakmal

Associate Technical Specialist at Pearson, Sri Lanka. Technology junky, enthusiast, a VMware vExpert and a blogger with more than 7 years of Experience in Information Technology more focusing on VMware Virtualization, Microsoft and Datacenter Technologies.

Get Updates Directly To Your Inbox!

   

Show 2 comments

Leave a Reply

Loading Posts...