Tunnel using PuTTY - equivalent for ssh command?
I am trying to connect to a remote server, based on the instructions given on this page:
https://bokeh.pydata.org/en/latest/docs/user_guide/server.html#ssh-tunnels
It suggests to create a tunnel from my local machine to my server using the command:
ssh -NfL localhost:5006:localhost:5006 [email protected]
However my local machine is Windows - being a beginner programmer I have trouble figuring out how to reproduce the above mention command, but with PuTTY.
Could anyone help me out with that?
Thanks
You can do this directly with Putty command line:
putty.exe -L 5006:<remote_host>:5006 -P 22 -l <user> -pw <pwd>
where
-
<remote_host>
is your remote host (running the server listening on port 5006) -
<user>
/<pwd>
are the credentials to access via SSH to<remote_host>
assuming SSH port is 22
PuTTY comes with console client Plink.
Plink has the same command-line syntax as OpenSSH ssh
except:
- for the
-f
switch, which does not have an equivalent in Windows. - and you cannot combine multiple switches after one dash - so instead of
-NL ...
, you have to use-N -L ...
.
So, you can use:
plink.exe -N -L localhost:5006:localhost:5006 [email protected]
Reference: Using the command-line connection tool Plink
Alternatively you can setup the tunnel in PuTTY GUI.
See How to create SSH tunnel using PuTTY in Windows?