Skip to content

Instantly share code, notes, and snippets.

@terrywang
Created March 6, 2022 22:42
Show Gist options
  • Save terrywang/0aa83822c501a541071c6bf39f08db40 to your computer and use it in GitHub Desktop.
Save terrywang/0aa83822c501a541071c6bf39f08db40 to your computer and use it in GitHub Desktop.
Using AWS SSM for SSH Dynamic Forwarding so as to access services in private subnet
Host ssm-tatooine
ProxyCommand sh -c "aws ssm start-session --target <instance id> --region <region> --document-name AWS-StartPortForwardingSession --parameters '{\"portNumber\":[\"22\"],\"localPortNumber\":[\"22222\"]}'"
Host dynamic-forwarding
Hostname localhost
user terry
IdentityFile ~/.ssh/r2d2_ed25519
Port 22222
UserKnownHostsFile /dev/null
DynamicForward 1080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment