Skip to content

Instantly share code, notes, and snippets.

@hernandesbsousa
Created November 18, 2016 00:18
Show Gist options
  • Save hernandesbsousa/2a656ae61ddf181b1cf73a09db1e9bb4 to your computer and use it in GitHub Desktop.
Save hernandesbsousa/2a656ae61ddf181b1cf73a09db1e9bb4 to your computer and use it in GitHub Desktop.
Run command using bastion host through ssh
# run a command in a machine protected by a VPN
# through a publicly-accessible bastion host
# more info can be found on this great blog post
# http://blog.scottlowe.org/2015/11/21/using-ssh-bastion-host/
ssh -o ProxyCommand='ssh user@bastion.public.host -W %h:%p -i ~/.ssh/mykey' \
user@destination.internal.host -i ~/.ssh/mykey my_command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment