alpha645
2007-03-18, 10:52 AM CDT
When I was just using Linux, I used the VNC-server guide from Firewing1 However, this server was not that secure because it didn't use VncAuth. And, the listening port that VNC uses is also used in the howto by Firewing1. I was amazed how many people tried to log in throuh VNC into my computer on daily basis. So I decided to take some countermeasures (and an extra feature).
In this guide, I will describe a way to:
- Use VncAuth (secure)
- Change listening port (a lot more secure)
- You can watch what the remote side is doing (fun :) )
Do this all as su.
su -
First, we install the VNC server:
yum -y install vnc vnc-server
Then we configure xorg.conf
gedit /etc/X11/xorg.conf
or
kedit /etc/X11/xorg.conf
or
mousepad /etc/X11/xorg.conf
Add the following components:
In the module section you add the VNC module (my xorg.conf is attached to serve as an example):
Load "vnc"
In the screen section you add some more (my xorg.conf is attached to serve as an example):
Option "SecurityTypes" "VncAuth"
Option "UserPasswdVerifier" "VncAuth"
Option "PasswordFile" "/root/.vnc/passwd"
Option "rfbport" "57000" # Defines which port VNC listens on
Option "SendCutText" "0" # I disable this for more security/stability (this disables the clipboard)
Option "AcceptCutText" "0" # I disable this for more security/stability (this disables the clipboard)
Option "NeverShared" "0" # Never allow more than one user
Option "IdleTimeout" "10" # Timeout in seconds (I think)
Close xorg.conf
Next, we define a password:
vncpasswd
Type your password twice as asked.
Now you must reboot.
To connect with loopback:
127.0.0.1:<the port you defined above>
Enter the password you entered at vncpasswd and voila :) . This is a great way to help others :D .
In this guide, I will describe a way to:
- Use VncAuth (secure)
- Change listening port (a lot more secure)
- You can watch what the remote side is doing (fun :) )
Do this all as su.
su -
First, we install the VNC server:
yum -y install vnc vnc-server
Then we configure xorg.conf
gedit /etc/X11/xorg.conf
or
kedit /etc/X11/xorg.conf
or
mousepad /etc/X11/xorg.conf
Add the following components:
In the module section you add the VNC module (my xorg.conf is attached to serve as an example):
Load "vnc"
In the screen section you add some more (my xorg.conf is attached to serve as an example):
Option "SecurityTypes" "VncAuth"
Option "UserPasswdVerifier" "VncAuth"
Option "PasswordFile" "/root/.vnc/passwd"
Option "rfbport" "57000" # Defines which port VNC listens on
Option "SendCutText" "0" # I disable this for more security/stability (this disables the clipboard)
Option "AcceptCutText" "0" # I disable this for more security/stability (this disables the clipboard)
Option "NeverShared" "0" # Never allow more than one user
Option "IdleTimeout" "10" # Timeout in seconds (I think)
Close xorg.conf
Next, we define a password:
vncpasswd
Type your password twice as asked.
Now you must reboot.
To connect with loopback:
127.0.0.1:<the port you defined above>
Enter the password you entered at vncpasswd and voila :) . This is a great way to help others :D .