Skip to content

Instantly share code, notes, and snippets.

@dasgoll
Last active October 21, 2022 09:47
Show Gist options
  • Select an option

  • Save dasgoll/7aed115c8f617d244c8d059acaa6ad39 to your computer and use it in GitHub Desktop.

Select an option

Save dasgoll/7aed115c8f617d244c8d059acaa6ad39 to your computer and use it in GitHub Desktop.
SSH to ec2 instance using EC2 Instance Connect
aws ec2-instance-connect send-ssh-public-key --instance-id i-XXYYZZ --availability-zone eu-central-1c --instance-os-user ec2-user --ssh-public-key file:///home/foo/.ssh/id_rsa.pub --profile devops
ssh ec2-user@PUBLIC_IP
OR
pip install ec2instanceconnectcli
mssh ec2-user@i-XXYYZZ --profile devops
###
https://aws.amazon.com/blogs/infrastructure-and-automation/securing-your-bastion-hosts-with-amazon-ec2-instance-connect/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment