Detailed description of VNC Server Configuration Under RHEL 6

Source: Internet
Author: User

 

Linux can be controlled by using SSH remote connection, or the following command can be executed on the host for projection.

[Root @ localhost ~] # Export DISPLAY = ipaddress: 0

[Root @ localhost ~] # Xhost + this command requires that the ipaddress machine is equipped with X Server (for example, Xmanager), but sometimes the entire remote Linux desktop needs to be projected to the local device. In this case, you can still install and configure Xmanager.

This article describes how to configure the VNC Server. You need to configure the yum source. The "host" in this article refers to the machine on which Linux is installed.

1. verify whether the VNC Server is installed on the host.

[Root @ localhost ~] # Yum list | grep vnc command. Return

Tigervnc. x86_64 1.0.90-0.10.20100115svn3945.el6 @ local

Tigervnc-server.x86_64 1.0.90-0.10.20100115svn3945.el6 @ local indicates that it already exists, otherwise it passes

[Root @ localhost ~] # Yum install "* vnc *" command.

2. Then start the VNC Server. You are required to enter the initial password for two connections.

[Root @ localhost ~] # Vncserver

You will require a password to access your tops.

Password: // enter the Password

Verify: // enter the password again

Xauth: creating new authority file/root/. Xauthority

New 'localhost. localdomain: 1 (root) 'desktop is localhost. localdomain: 1

Creating default startup script/root/. vnc/xstartup

Starting applications specified in/root/. vnc/xstartup

Log file is/root /. vnc/localhost. localdomain: 1. log Note: each user can start multiple VNC Server Remote desktops, which are identified by ip and port number: ip: 1, ip: 2, ip: 3, using the same port will automatically cause other users to log out. In addition, most configuration files and log files of the VNC Server are in the. vnc directory of the user's home directory.

You can customize the startup number, for example:

[Root @ localhost ~] # Vncserver: 2 # Note: There must be spaces in front of 2.

A vnc server is already running as: 23. Red Hat Linux supports two graphical modes: KDE mode and gnome mode.

What graphic mode does your Redh Hat use? Generally, you only need to log on to the graphic interface to view it.

[Root @ localhost ~] # Ps-aux | grep gnome command to determine.

For gnome desktop, You need to modify the configuration file of/root/. vnc/xstartup.

Use vi to open the xstartup file, as shown below:

[Root @ localhost/] # cd/root/. vnc

[Root @ localhost. vnc] # vi xstartup delete all content and add the following content:

Unset SESSION_MANAGER

Exec/etc/X11/xinit/xinitrc4. restart the VNC Server.

[Root @ localhost ~] # Vncserver-kill: 1

Killing Xvnc process ID 21198.

[Root @ localhost ~] # Vncserver

New 'localhost. localdomain: 1 (root) 'desktop is localhost. localdomain: 1

Starting applications specified in/root/. vnc/xstartup

Log file is/root/. vnc/localhost. localdomain: 1. log5. open the listening port of the VNC Server on the firewall.

The VNC Server uses three ports: 5801, 5901, and 6001.

[Root @ localhost/] # cd/etc/sysconfig

[Root @ localhost sysconfig] # Add the following three lines to vi iptables:

-A input-m state -- state NEW-m tcp-p tcp -- dport 5801-j ACCEPT

-A input-m state -- state NEW-m tcp-p tcp -- dport 5901-j ACCEPT

-A input-m state -- state NEW-m tcp-p tcp -- dport 6001-j ACCEPT note that

-A input-j REJECT -- reject-with icmp-host-prohibited, otherwise it will not take effect.

6. Restart iptables.

[Root @ localhost sysconfig] #/etc/rc. d/init. d/iptables restart

Flushing firewall rules: [OK]

Setting chains to policy ACCEPT: filter [OK]

Unloading iptables modules: [OK]

Applying iptables firewall rules: [OK]

Loading additional iptables modules: ip_conntrack_netbios_ns ip_conntrack_ftp [OK] 7. Connect to the VNC Server using VNC Viewer on a Windows machine

 

 

Download the VNC Viewer, run it, enter IP: 5901, enter the password you just set, and enter the RHEL desktop.

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.