How to configure vnc in centOS5.5 (enable linux remote desktop)

Source: Internet
Author: User
How can I remotely control the centOS desktop? How to remotely control centOS desktop CentOS 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(If you do not modify this file, the remote desktop you see is very simple. it is equivalent to a command line operation. to perform remote operations like local operations, make sure to modify the 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)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.