Skip to content

Instantly share code, notes, and snippets.

@riywo
Created July 19, 2023 03:49
Show Gist options
  • Save riywo/2631cf68e833cf492616b4ad0db87e08 to your computer and use it in GitHub Desktop.
Save riywo/2631cf68e833cf492616b4ad0db87e08 to your computer and use it in GitHub Desktop.
Host i-*
GSSAPIAuthentication no
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
LogLevel ERROR
IdentityFile ~/.ssh/id_rsa
ProxyCommand sh -c 'aws ec2-instance-connect send-ssh-public-key --instance-id %h --instance-os-user %r --ssh-public-key file://~/.ssh/id_rsa.pub && exec aws ec2-instance-connect open-tunnel --instance-id %h'
@riywo
Copy link
Author

riywo commented Jul 19, 2023

SSH to Amazon EC2 instance using EC2 Instance Connect.

ssh root@i-aaaaaaaaaa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment