How To Install SSM Agent on Linux EC2 Instances

Steps To Install SSM Agent on Linux EC2 Instances

AWS Systems Manager Agent (SSM Agent) is Amazon software that can be installed and configured on an EC2 instance, an on-premises server, or a virtual machine (VM). SSM Agent makes it possible for Systems Manager to update, manage, and configure these resources. The agent processes requests from the Systems Manager service in the AWS Cloud, and then runs them as specified in the request. SSM Agent then sends status and execution information back to the Systems Manager service by using the Amazon Message Delivery Service.

Create EC2 Role for ssm

before installing ssm agent on linux server, you have to create a role with AmazonSSMFullAccess policy and attaché this role to your Ec2 instance. login to your AWS Management Console and navigate to the IAM console, here you can see the roles and create role.

AWS console–> IAM console —> Choose Roles —> Choose Create New Role—>AmazonSSMFullAccess.

install ssm agent on linux

Choose the service that will use this role as ec2 and in attach permissions policies select AmazonSSMFullAccess

create ssm role for linux

 

after adding policy give the role name and save it. we have created ssm role to install ssm agent in linux

how to install ssm agent on linux

Add SSM role to Linux EC2 instance

install ssm agent in linux

while you are lunching ec2 instance add your newly created ssm role to ec2 instance and in user data add below commands to install sssm agent.

Install SSM Agent on Amzon Linux

By adding below commands in userdata, you can install aws ssm agent on amazon linux machines.

#!/bin/bash
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
sudo start amazon-ssm-agent
sudo systemctl enable amazon-ssm-agent

Install SSM Agent on Ubuntu 18.04 and 16.04

By adding below commands in userdata, you can install aws ssm agent on ubuntu 16.04

#!/bin/bash
mkdir /tmp/ssm
cd /tmp/ssm
wget https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_amd64/amazon-ssm-agent.deb
sudo dpkg -i amazon-ssm-agent.deb
sudo start amazon-ssm-agent
sudo systemctl enable amazon-ssm-agent

Install SSM Agent on Centos 7

By adding below commands in userdata, you can install aws ssm agent on centos 7

#!/bin/bash
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
sudo systemctl enable amazon-ssm-agent
sudo systemctl start amazon-ssm-agent

by using above commands we can install ssm agent linux ec2 instances.

  • download and install ssm agent
  • how to check if ssm agent is installed on ec2
  • install ssm agent automatically
  • install ssm agent red hat
  • manually update ssm agent linux
  • install ssm agent via userdata

Leave a Reply

Your email address will not be published. Required fields are marked *