At the office I have on the servers a vnc server running. In Windows I use putty to connect to the server, I log in and then use realvnc to see the desktop. But I cannot get this to work on Linux. I have done it in the past struggling but never again. What I have done is try to bind my localhost to the port 5901 and then to the port 5901 on the server machine

ssh -L localhost:5901:server.dog.com:5901 [email protected]

I am using the vnc client "remote desktop viewer". Best,

1 Answer 1


Try ssh -f -L 5901:localhost:5901 server.dog.com -N

  • Yes, it seems to be a syntax problem. 5901 will also only work if the vncserver was started on port 1 (e.g., 'vncserver :1')
    – Barthelemy
    Oct 13, 2010 at 20:08
  • 1
    yes. 5901 is just from the example above. the first port is the local port, the second port is the remote port btw.
    – txwikinger
    Oct 13, 2010 at 20:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .