Skip to content

Instantly share code, notes, and snippets.

@andmax
Last active Dec 12, 2019
Embed
What would you like to do?
Tunnel port through ssh gateway useful for tensorboard/notebook behind a firewall
ssh -L <local-port>:<2nd-pc-address>:<2nd-pc-port> <1st-pc-address>
=
Host target-forwarding
Hostname <1st-pc-address>
User <1st-pc-username>
LocalForward <local-port> <2nd-pc-address>:<2nd-pc-port>
IdentityFile <1st-pc-identity-file>
# if unix is the gateway (1st-pc) and has its own configuration
Host unix-gateway
User <1st-pc-username>
Port <1st-pc-port>
HostName <1st-pc-address>
IdentityFile <1st-pc-identity-file>
Host target-forwarding
User <2nd-pc-username>
HostName <2nd-pc-address>
ProxyCommand ssh -aT unix-gateway nc %h %p
IdentityFile <2nd-pc-identity-file>
# if windows is the gateway (1st-pc) then have cygwin64/nc.exe installed and do:
Host windows-gateway
User <1st-pc-username>
Port <1st-pc-port>
Hostname <1st-pc-address>
IdentityFile <1st-pc-identity-file>
Host target-forwarding
User <2nd-pc-username>
HostName <2nd-pc-address>
ProxyCommand ssh -aT windows-gateway c:\\cygwin64\\bin\\nc.exe %h %p
IdentityFile <2nd-pc-identity-file>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment