Linux study--redhat EL6 configuring VNC server

Source: Internet
Author: User
Tags gtk

Linux study--redhat EL6 configuring VNC server


System environment:

Operating system: RedHat EL6.4 (64)


RH6 the installation and configuration of the VNC server is slightly different from the RH5, the following cases are installed on the RH EL6.4 to configure the VNC server

1. View the VNC installation package

gtk-vnc-0.3.10-3.el6.x86_64
libvncserver-0.9.7-4.el6.x86_64
gtk-vnc-python-0.3.10-3.el6.x86_64

You need to install the Tigervnc-server package on Rh6
[[email protected] ~]# yum install-y vnc-server

Loaded plugins: product-id, refresh-packagekit, security, subscription-managerthis  system is not registered to red hat subscription management.  you can use subscription-manager to register. setting up install processresolving dependencies--> running transaction  Check---> package tigervnc-server.x86_64 0:1.1.0-5.el6 will be installed-- > finished dependency resolutiondependencies resolved================================== ================================================================================ package                           Arch                    version                         repository            size====== ============================================================================================================installing : tigervnc-server                  x86_64                  1.1.0-5.el6                     base                  1.0 mtransaction summary================================== ================================================================================install       &nBsp;1 package (s) total download size: 1.0 minstalled size: 2.6  Mdownloading packages:running rpm_check_debugrunning transaction testtransaction test  succeededrunning transaction  installing : tigervnc-server-1.1.0-5.el6.x86_64                                                                 1/1   Verifying  :  tigervnc-server-1.1.0-5.el6.x86_64                                                                1/1 Installed:  tigervnc-server.x86_64 0:1.1.0-5.el6                                                                                 complete!

2. Configure VNC Server
[Email protected] ~]# vi/etc/sysconfig/vncservers

# vncservers= "2:myusername"
# vncserverargs[2]= "-geometry 800x600-nolisten tcp-localhost"

vncservers= "1:root"//installation prompts to add VNC server-initiated endpoints and connected user
~
3. Set password for user connection

[email protected] ~]# vncpasswd
Password:
Password must is at least 6 characters-try again
Password:
Verify:

4. Start VNC server (port:5900, 5901)
[[Email protected] ~]# service Vncserver start
starting VNC server:1:root xauth:creating new Authority file/root/. Xauthority
New ' rh64:1 (root) ' Desktop is rh64:1
Creating default startup Script/root/.vnc/xstartup
starting applications specified In/root/.vnc/xstartup
Log file Is/root/.vnc/rh64:1.log
[OK]

Installing the VNC tool Vncviewer
[email protected] packages]# RPM-IVH tigervnc-1.1.0-5.el6.x86_64.rpm
warning:tigervnc-1.1.0-5.el6.x86_64.rpm:header V3 rsa/sha256 Signature, key ID Fd431d51:nokey
Preparing ... ########################################### [100%]
1:tigervnc ########################################### [100%]

5. Connect Vncserver via Vncviewer (you can also use the browser or Vncviewer client under Windows)
[Email protected] packages]# export display=192.168.8.83:0.0
[email protected] packages]# vncviewer

650) this.width=650; "Src=" http://img.blog.csdn.net/20151126143226287?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none; "/>


Connection Successful

650) this.width=650; "Src=" http://img.blog.csdn.net/20151126143357626?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none; "/>


6. Firewall Configuration


Although the above process has been completed and the Vncserver service is started, it is still not connected, the possible reason is that the request was blocked by the firewall. So here's how to configure the firewall.

When the VNC service is running, use NETSTAT-ANTPL to see that there are three ports in the listener.

5901 5801 6001

By default, the VNC service listens on 3 TCP ports

RFB (Remote FrameBuffer) protocol default port: 5900+ Display Number

HTTP protocol default port: 5800+ Monitor Number

X protocol default port: 6000+ Display Number

Vncserver the display number used by default starts at 1, is used in turn, or the parameter specifies the port number.

Because we need to establish a remote connection, we only need the RFB protocol.

The procedure for configuring a firewall is described below.

[Email protected] ~]# Vi/etc/sysconfig/iptables

The contents of the file are

# Firewall configuration written by System-config-firewall

# Manual Customization of this file are not recommended.

*filter

: INPUT ACCEPT [0:0]

: FORWARD ACCEPT [0:0]

: OUTPUT ACCEPT [0:0]

-A input-m state--state established,related-j ACCEPT

-A input-p icmp-j ACCEPT

-A input-i lo-j ACCEPT

-A input-m state--state new-m tcp-p TCP--dport 22-j ACCEPT

-A input-j REJECT--reject-with icmp-host-prohibited

-A forward-j REJECT--reject-with icmp-host-prohibited

COMMIT

According to the configuration in the/etc/sysconfig/vncservers file, we need to open a port number of 5901, just

-A input-m state--state new-m tcp-p TCP--dport 22-j ACCEPT

Add a row below

-A input-m state--state new-m tcp-p TCP--dport 5901-j ACCEPT

The 5901 port is turned on.


This article is from the "Tianya blog," Please make sure to keep this source http://tiany.blog.51cto.com/513694/1717087

Linux study--redhat EL6 configuring VNC server

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.