Multi-hop jump chain

Chain multiple jump hosts in one command

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

tool
ssh15 commands
tags
sshnetwork

More ssh commands

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

    Forward localhost:5432 to db.internal:5432 via bastion

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

    Expose local port 3000 as port 8080 on VPS

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

    Create a local SOCKS5 proxy tunnelled through VPS

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

    Reuse existing connection for subsequent SSH commands

  • ssh user@host 'sudo systemctl status nginx'

    Execute a command over SSH without interactive shell

all 15 ssh commands