VNC over SSH

ebberz

Member
Oct 8, 2009
36
0
0
I'm sure this has been asked before but couldn't pick it out via the search.

I've got a Centos v6.4 server running on a VM however I want to try connecting to it as if it was a standard machine from my Windows 7 client machine.

The easiest method I could see was to use putty and configure the SSH tunnels with a source port of 5900 and destination port of localhost:5900.

So I can make the ssh connection and login, however when firing up tightVNC and pointing the client at localhost::5900 (or just localhost on its own using the default) I get a connection has been gracefully closed.

Can't see a logfile for it, there's nothing in /var/log/messages on the target host, DISPLAY on the server is set to :0.0.

Not sure where I need to look to sort it?
Thanks
 

smakme7757

Golden Member
Nov 20, 2010
1,487
1
81
Doesn't VNC encrypt the connection? Is there any reason why you first want to tunnel with SSH and then use VNC?
 

Red Squirrel

No Lifer
May 24, 2003
70,032
13,493
126
www.anyf.ca
I've seen this before, I think it has to do with a slow connection or improper tunnel. Do double check that the port and server match up though. Remember localhost:port is localhost on the server you are SSHing into. Sometimes VNC ends up on 5901 for some reason. Also locally instead of connecting to localhost try connecting to 127.0.0.2 or something. (anything in 127.0.0.0/8 range is localhost)

SSH tunnel is the way to go for this though, you don't want to open up the VNC port to the public. it makes another potential attack avenue. Have SSH open only and setup fail2ban for brute force protection. Idealy use another port for SSH too. Keeps your log files clean from all the bots.