Skip to content

Instantly share code, notes, and snippets.

@muhmi
Created March 27, 2015 12:58
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 muhmi/f37c827885d068ac85cf to your computer and use it in GitHub Desktop.
Save muhmi/f37c827885d068ac85cf to your computer and use it in GitHub Desktop.
Route SSH connections through a bastion host
Host bastion_ip
User ec2-user
HostName ##.##.##.##
ProxyCommand none
IdentityFile ~/.ssh/bastion_key.pem
BatchMode yes
PasswordAuthentication no
Host *
ServerAliveInterval 60
TCPKeepAlive yes
ProxyCommand ssh -q -A ec2-user@bastion_host -i ~/.ssh/bastion-key.pem nc %h %p
ControlMaster auto
ControlPath ~/.ssh/mux-%r@%h:%p
ControlPersist 8h
User ubuntu
StrictHostKeyChecking no
IdentityFile ~/.ssh/applicatio-server-key.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment