Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 vass@server.dog.com

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

share|improve this question
up vote 2 down vote accepted

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

share|improve this answer
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 '10 at 20:08
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 '10 at 20:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.