Skip to content

Instantly share code, notes, and snippets.

@LTGIV
Last active August 29, 2015 14:15
Show Gist options
  • Save LTGIV/0a8bd0f07be3f926d973 to your computer and use it in GitHub Desktop.
Save LTGIV/0a8bd0f07be3f926d973 to your computer and use it in GitHub Desktop.
Ansible with Bastion Host(s)
#
# Route all superserver####.example.com connections through superserver9001.example.com
# Save as: ~/ssh/config
#
# A very special thank you to Alex Bilbie:
# http://alexbilbie.com/2014/07/using-ansible-with-a-bastion-host/
#
Host superserver9001.example.com
User userNameHere1
HostName superserver9001.example.com
ProxyCommand none
BatchMode yes
PasswordAuthentication no
Host superserver*.example.com
ServerAliveInterval 60
TCPKeepAlive yes
ProxyCommand ssh -A userNameHere1@superserver9001.example.com nc %h %p
ControlMaster auto
ControlPath ~/.ssh/mux-%r@%h:%p
ControlPersist 8h
User userNameHere2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment