SSH bastion | SSH Jump host


If you don't have access to an instance in a private network but you have a jump host (bastion) with public ip address within the same private network, then this jump host could be a bridge between you and an an instance

Syntax to use jump host

ssh -i "<ssh_pem_file>" \
-o "ProxyCommand ssh -i "<ssh_pem_file>" -W %h:%p <jump_host_user>:<jump_host_ip>" \
NOTE: Be sure, you've added <ssh_pem_file> to the jump host and private instances

Example of using Bastion host to SSH

The next command will connect to the address via jump host
ssh -i "aws_ireland.pem" \
-o "ProxyCommand ssh -i "aws_ireland.pem" -W %h:%p [email protected]" \

SSH command options

  • -i – a path to a file (private key)
  • -v – verbose mode
  • -q – quiet mode
Last modified 1yr ago