Skip to content

Instantly share code, notes, and snippets.

@rdkls
Last active April 27, 2023 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdkls/89b1488789c834ded480b46e0ca90d3f to your computer and use it in GitHub Desktop.
Save rdkls/89b1488789c834ded480b46e0ca90d3f to your computer and use it in GitHub Desktop.
# brew install session-manager-plugin
# Bootstrap your ssh key to ec2 instance, then start ssh session over ssm to it
# Since it's plain ssh can then e.g. port forward and all the funky stuff
Host i-* mi-* ssm-jumphost
User ec2-user
IdentityFile ~/.ssh/nick-doyle-slalom-lab-ed25519
ProxyCommand sh -c "aws ec2-instance-connect send-ssh-public-key --instance-id %h --ssh-public-key '$(cat ~/.ssh/nick-doyle-slalom-lab-ed25519.pub)' --instance-os-user ec2-user; aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment