Enter your email address:

Delivered by FeedBurner

Secure VNC using SSH


StumbleUpon Toolbar

As VNC is not a secure way to connect to your linux server, you can run VNC over an SSH connection, here is how

First install your vnc server
- For Fedora and CentOS

yum install vnc vnc-server

- For Debian and Ubuntu

apt-get install vncserver

Configure your VNC server

- Run this command, this will start your vncserver running in "possition" 20, with 8 bits of colour and a screen of 1024x768

vncserver :20 -depth 8 -geometry 1024x768

- Stop the server use this other command

vncserver -kill :20

- Edit the applications file, to have your GNOME or KDE running when you connect to the PC using VNC

** Only for Fedora and CentOS **

vi ~/.vnc/xstartup

- Here be sure you have a content like this

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &

Configure Putty on Windows

- Open VNCViewer on your windows and point to your localhost:20

- You should see something like this.

Special Thanks to Guy Boisvert and Theo Band

Trackback URL for this post:

http://www.go2linux.org/trackback/15
StumbleUpon Toolbar

 If you like this article, subscribe to our full rss

If this article was somehow useful for you, you can leave something in the tip's jar

Please post your question in our forum and use comments only to leave your comments about the article, thanks.

Thanks!

Thanks!

Hi guys, this works for

Hi guys, this works for me.
I had to bear this in mind though;

You DONT need a X Server on the remote linux box. VNCServer acts like a XServer.

5920 is the port that vncserver listens on - see the putty screenshot

localhost:20 is from "vncserver :20"

follow the instructions exactly, use port 20 etc... and it will work.

I can confirm that you DONT nedd to open port 5920 on the server for inbound traffic - this is specifically why this solution rules

kind regards,

stu

Thank you very much for this

Thank you very much for this article.... it worked straight away!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

This site is proudly hosted at Bluefur Hosting