ssh -f <user>@<ssh-server-address> -p <ssh-port> -L <source-port>:<destination-address>:<destination-port> -NSo say you wanted to vnc though an ssh tunnel you could use this command:
ssh -f user@my-ssh-server -p 2299 -L 5910:my-vnc-server:5900 -NThen in your vnc client you would connect to:
localhost:5910So what's happening here?
First you're logging in via ssh to my-ssh-server on port 2299 (ssh -f user@my-ssh-server -p 2299), you don't need to specify the port unless it is different from the default (22).
The -f tells ssh to run in the background.
Then you're telling any traffic on port 5910 to forward to my-vnc-server on port 5900 (-L 5910:my-vnc-server:5900).
The -N instructs OpenSSH to not execute commands on the remote system.
0 comments:
Post a Comment