Linux configuration vnc realizes Linux remote desktop

  

VNC (Virtual Network Computing) is an abbreviation of virtual network computer. VNC is an excellent remote control tool developed by the renowned AT&T European Research Laboratory. VNC is a free open source software based on UNIX and Linux operating systems. It is powerful, efficient and practical, and its performance is comparable to any remote control software in Windows and MAC. In Linux, VNC includes the following four commands: vncserver, vncviewer, vncpasswd, and vncconnect. In most cases I only need two of these commands: vncserver and vncviewer.

Installation method:

1: First check whether your system has vnc service installed (default is installed)

rpm -q vnc vnc-server
command output is:

package vnc is not installed

vnc-server-4.1.2-14.el5_3.1

then the installation is complete, No need to install again.

2: Modify the user's configuration file

# vi /etc/sysconfig/vncservers

The changes are as follows:

VNCSERVERS="1:root" ; channel number used, username used

VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -nohttpd -localhost" Adjusting the resolution of the remote desktop

3: Setting up the remote Login password

#vncpasswd

4: Modify remote desktop, display configuration file parameters

# vi ~/.vnc/xstartup

# twm & ;

Comment out twm, add the following two lines

gnome-session &

startkde &

save, as in the first configuration Without this configuration file, you need to start the vnc service and it will produce the xstarup file.

4: Start vnc service

/sbin/service vncserver start

5: Firewall settings

If you have a firewall, follow the configuration below

vi /etc/sysconfig/iptables

Open the configuration file with the vi editor and add the following line to the file

-A RH-Firewall-l-INPUT -p tcp - m tcp --dport 5900:5903 -j ACCEPT

Restart the firewall to make the configuration file effective

Service iptables restart

6: You can now log in remotely, open VNC Viewer

Enter the server IP address, plus channel number

For example: 192.168.20.242:1

7: Enter the login password, this password is the vnc login password, not the system Login Password

8: Login System Interface

Copyright © Windows knowledge All Rights Reserved