Skip to content

Instantly share code, notes, and snippets.

@initcron
Created July 10, 2024 04:26
Show Gist options
  • Save initcron/138b36bac923836d340d5e204a02d916 to your computer and use it in GitHub Desktop.
Save initcron/138b36bac923836d340d5e204a02d916 to your computer and use it in GitHub Desktop.
Connect to a server in private network (Private subnets of VPC) ~/.ssh/config
Host public
Hostname x.x.x.x
User ubuntu
IdentityFile ~/.ssh/path_to_key1.pem
Host private
HostName y.y.y.y
User ec2-user
ProxyCommand ssh -W %h:%p public
IdentityFile ~/.ssh/path_to_key2.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment