Ubuntu EC2 instance connect for Cli SSH with Azure-AD SSO or for traditional SSH access.
SETTING-UP EC2 INSTANCE CONNECT FOR CLI SSH ACCESS UBUNTU There are different ways of gaining SSH access for EC2 instances here we will see SSH access for EC2 instance through Cli. This method best suits if you use Azure-AD SSO with AWS. Setting up EC2 instance connect: EC2 instance connect needs followings, 1. Amazon Linux 2 of any version OR 2. Ubuntu 16.04 or later. For Ubuntu: First connect to your EC2 instance with Sudo access and become Sudo. then update and upgrade your instance sudo apt update -y && sudo apt upgrade -y sudo apt install ec2-instance-connect -y Now attach a policy like this to the IAM user in order to send the instance SSH key. Replace the AWS-ACCOUNTID with your ID. You can also customise based on your need like access to certain instances. This role gives access to all instances in your account. { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEdit