SSH notes

Created at 2024-02-29 11:42
Last edited at 2024-10-06 11:51

Tunnel a remote port to localhost through a jump host

With -o ProxyCommand:

ssh -o ProxyCommand='ssh -W %h:%p -i myssh.key $user@$jumpserver_ip' -i myssh.key -L $local_port:$address_to_forward:$port_to_forward $user@$remote_ip

Or with -J and the follwing ~/.ssh/config:

Host <jumpserver_ip>
    User <user>
    IdentityFile /path/to/myssh.key
ssh -J $user@$jumpserver_ip -i myssh.key -L $local_port:$address_to_forward:$port_to_forward $user@remote