Jump through a bastion

Reach an internal host through one bastion host with ProxyJump

ssh -J bastion.example.com user@internal-host

tool
ssh15 commands
tags
sshnetwork

More ssh commands

  • ssh -J user@bastion1,user@bastion2 user@target

    Chain several jump hosts in one command

  • ssh -L 5432:db.internal:5432 user@bastion -N

    Forward localhost:5432 to db.internal:5432 through the bastion

  • ssh -R 8080:localhost:3000 user@vps -N

    Make local port 3000 available as port 8080 on the VPS

  • ssh -D 1080 user@vps -N -f

    Create a local SOCKS5 proxy on port 1080 that tunnels through the VPS and runs in the background

  • ssh -o ControlMaster=auto -o ControlPath=~/.ssh/mux-%r@%h:%p -o ControlPersist=10m user@host

    Later SSH commands reuse the open connection; it stays alive 10 minutes after you exit

all 15 ssh commands