Home

Awesome

aws-ssm-ssh-proxy-command starline

Open an SSH connection to your AWS SSM connected instances without the need to open any ssh port in you security groups.

[!Tip] If you only need to connect to AWS EC2 instances you could use the ec2-instance-connect variant of this proxy command. This variant allows you to manage wich IAM identity can connect to which OS user on the target instance. See EC2 Only Variant

Prerequisits

Usage

Usage without SSH Config

If you have not setup an SSH Config you can use the following ssh command options to use this proxy command.

EC2 Only Variant

If you only want to connect to EC2 instances you can make use of EC2 Instance Connect SendSSHPublicKey command as a drop in replacement for the SSM SendCommand to temporary add your public key to the target instance.

The advantage from this variant is that you don't need to grant ssm:SendCommand to users and there by the permission to execute everything as ssm-user or root. Instead you grant ec2-instance-connect:SendSSHPublicKey permission and optionaly restrict it to a specific OS user e.g. ec2-user.

To do so just use Proxy Command Script and IAM Policy Template from the ec2-instance-connect folder instead.