

Make sure your instance has latest SSM agent installed.
SSM SESSION MANAGER INSTALL
Install Session Manager pluginon the machine you want to connect to your instance from. AWS Session Manager is a one of three dedicated AWS services enabling command line access to an EC2 instance without the required ssh key (others are: EC2.Have installed latest aws-cliinstalled. SSH over Session Manager host i- mi- Prox圜ommand sh -c 'aws ssm start-session -target h -document-name AWS-StartSSHSession -parameters 'portNumberp'' Then In above code, I have tried to start a session with below code and that is also successfully.An EC2 in a private subnet with route to a NAT Gateway. An EC2 in a public subnet with public ip and route to an Internet Gateway. Your can find out more information about EC2 instance profiles and IAM roles for SSM over here.Įnabling SSH over SSM from your local machineįirst of all we need to make sure we meet all the prerequisites: Here we have two CloudFormation templates that demonstrate three Session Manager connectivity scenarios. You can now connect to your instance through Session Manager. Next select IAM role we have created in the previous stepģ.Helper tools for AWS Systems Manager: ec2-session, ec2-ssh and ssm-tunnel, and for ECS Docker Exec: ecs-session Scripts included. Click on Actions, select Security, and then Modify IAM role aws-ssm-tools - AWS System Manager Tools.Go to EC2 instances, select the instance you would like to enable SSM on. For information about using the AWS CLI to turn on KMS key encryption of session data in your account, see Create a Session Manager preferences document (command line) or Update Session Manager preferences (command line).Next add newly created role as your instance profile: The agent processes requests from the Systems Manager service. SSM Agent makes it possible for Systems Manager to update, manage, and configure these resources. To add SSM permissions to an existing role, find the role that is attached to the instance, and then add SSM permissions as an inline policy.Ģ. AWS Systems Manager Agent (SSM Agent) is Amazon software that runs on Amazon Elastic Compute Cloud (Amazon EC2) instances, edge devices, on-premises servers, and virtual machines (VMs). Add AmazonSSMManagedInstanceCore policy to your role or AmazonSSMFullAccess if you require to grant all Systems Manager permissions and click next.You can do that either by creating a new IAM role with Session Manager permissions or by adding inline policy permissions to an existing role already attached to our instance. Create IAM instance profile to allow Sessions Manager to connect to your instance (this is not enabled by default)

Setting up sessions manager on EC2 instanceġ.
SSM SESSION MANAGER HOW TO
This is a quick guide on how to set up sessions manager on your EC2 instance and enable SSH connections through SSM.
