CentOS Open VNC

Source: Internet
Author: User

Install packages (with Yum source installed, do not install with source code)

Yum Install VNC vnc-server

After the installation is successful, the configuration is as follows:

[[Email protected] ~]# vncserver #设置 vnc password, input: (Enter the user under a user is it, if the su imiss switch to Imiss user, the input vncserver is another desktop, the same to set the password, The password to be set under this user will be required for Vncserver to be launched under this account. You'll require a password to access your desktops. Password:password must is at least6Characters-try againPassword:Verify:xauth:creating new Authorityfile/root/. Xauthoritynew'localhost.localdomain:1 (Root)'Desktop is Localhost.localdomain:1Creating default startup script/root/.vnc/xstartupstarting Applications specifiedinch/root/.vnc/XstartuplogfileIs/root/.vnc/localhost.localdomain:1. Log[[email protected]~]# vncpasswd Password:password must be at least6Characters-try Againpassword:verify:[[email protected]~]#

To modify a configuration file:

Vim ~/.vnc/xstartup (last two lines)

#xterm-geometry 80x24+ten- ls"$VNCDESKTOP Desktop" &&Gnome-session &

Vim/etc/sysconfig/vncservers (last two lines)

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

Vi/etc/sysconfig/iptables (Configure firewall)

5901 -J Accept5902 -J Accept5903 -j Accept
#VNC the server listens on the port starting from 5900, Display:1 listens 5901,display:2 listens 5902, and so on. The CentOS firewall default is not allowed to connect these ports, so you need to use the following steps to open the firewall (requires root permission):

[Email protected] ~]# service iptables restartiptables:setting chains to policy Accept:nat mangle filte[ok
    
     ]iptables:flushing firewall rules:                         [  OK  ]iptables:unloading modules:                               [  OK  ]iptables: Applying firewall rules:                         [  OK  ]
    

Start the service

[[Email protected] ~~2'localhost.localdomain:2 (root)' Desktop is localhost.localdomain:2 in/root/.vnc/file is/root /.vnc/localhost.localdomain:2. Log                                                           [  OK  ~]#

Turn off VNC

Vncserver-Kill :2#注意kill后面要有一个空格

Connection

CentOS Open VNC

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.