Share the steps of configuring VNC under CentOS 5.5 (open Linux remote desktop)

Time:2021-10-12

1. Check whether VNC is installed on this computer (by default, vnc is installed on centos5)

rpm -q vnc vnc-server

If the result is:

package vnc is not installed
vnc-server-4.1.2-14.e15_3.1

Congratulations. VNC has been installed on the machine. If not, you have to install it yourself. I won’t say how to install it here. It’s very simple. Search in CentOS software library and click Install

2. Add remote desktop users to the configuration file

vi /etc/sysconfig/vncservers

Open the configuration file using the VI editor and add the following two lines of commands to the file

Vncservers = “1: root” — specifies the remote user

Vncservergars [1] = “- geometry 1024×768” — specify remote desktop resolution

3. Set the password for the remote desktop user root you just set

vncpasswd

4. Open VNC port

vi /etc/sysconfig/iptables

Open the configuration file using the VI editor and add the following line of command to the file

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

5. Restart the firewall

service iptables restart

6. Modify the remote desktop display profile(without modifying this file, the remote desktop you see is very simple, which is equivalent to command line operation. In order to make remote operation as local operation, you must refer to the following methods for modification)

cd ~/.vnc/

vi xstartup

Open the configuration file using the VI editor and make the following modifications

#Xterm – geometry 80×24 + 10 + 10 – LS – title “$vncdesktop desktop” & – annotate it and add # to represent annotation

#TWM & — annotate it

Gnome session & — add it

After reading this code, you should understand what’s going on

7. Start VNC service

/sbin/service vncserver start

8. Remote connection

Open the VNC client and enter IP: 1 in the server box (1 represents the remote user code configured above, and multiple remote users can be configured in the configuration file). At this time, you can easily control CentOS through a friendly remote desktop.

9. Start VNC automatically after startup

vi /etc/rc.d/rc.local

Open the configuration file using the VI editor and make the following modifications

/Etc / init.d/vncserver start — new line

New VI editor usage:

VI editor is divided into several modes

Command mode: the cursor can be moved, copied or deleted
Insert mode: text input can only be performed in this mode (press I to enter this mode from the command mode, and press ESC to exit this mode)
Bottom line mode: save the file and exit VI editor (enter: number followed by W fname — specify file name to save WQ — save exit q! — exit without saving)

Recommended Today

Seven Python code review tools recommended

althoughPythonLanguage is one of the most flexible development languages at present, but developers often abuse its flexibility and even violate relevant standards. So PythoncodeThe following common quality problems often occur: Some unused modules have been imported Function is missing arguments in various calls The appropriate format indentation is missing Missing appropriate spaces before and after […]