Centos Remote Desktop
How can I remotely control the centos desktop?
How does one remotely control the centos desktop using Windows?
1. Check whether VNC is installed on the local machine (VNC is installed on centos5 by default)
Rpm-q 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 on your own. Here we will not talk about how to install it. It is very simple. Search for it in the centos software library and click Install.
2. Add the Remote Desktop user to the configuration file.
VI/etc/sysconfig/vncservers
Use the VI editor to open the configuration file and add the following two lines of commands to the file:
Vncservers = "1: Root" -- specify a remote user
Vncserverargs [1] = "-geometry 1024x768" -- specify the Remote Desktop resolution
3. Set the password for the Remote Desktop user root you just set
Vncpasswd
4. Enable the VNC Port
VI/etc/sysconfig/iptables
Use the VI editor to open the configuration file and add the following 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 configuration file (it is very easy to modify the Remote Desktop without modifying this file, which is equivalent to a command line operation. To perform remote operations, make sure to modify the configuration file by referring to the following methods)
Cd ~ /. VNC/
VI xstartup
Open the configuration file in the VI editor and make the following changes:
# Xterm-geometry 80x24 + 10 + 10-ls-title "$ vncdesktop desktop" & -- comment it, and add # To indicate comment
# TWM & -- annotate it
Gnome-session & -- add it
After reading this code, you should understand what is going on.
7. Start the VNC service
/Sbin/service vncserver start
8. remote connection
Open the VNC client and enter IP address 1 in the server box (1 indicates the remote user code configured above. Multiple remote users can be configured in the configuration file ), then you can easily control centos through a friendly Remote Desktop.
9. Automatically Start VNC upon startup
VI/etc/rc. d/rc. Local
Open the configuration file in the VI editor and make the following changes:
/Etc/init. d/vncserver start -- add a row
Add VI editor usage:
VI editor is divided into several modes
Command mode: The cursor can be moved and copied or deleted.
Insert mode: In this mode, you can enter text (press I to enter this mode in command mode, and Press ESC to exit this mode)
Bottom row mode: Save the file and exit the VI Editor (Enter: Number, followed by W fname -- specify the file name to save WQ -- save and exit Q! -- Do not save and Exit)