CentOS of VNC Remote Desktop program installation and use tutorial _ server Other

Source: Internet
Author: User
Tags centos server iptables

This article illustrates the installation and use of VNC Remote Desktop program in CentOS. Share to everyone for your reference, specific as follows:

Here take CentOS 6.5 as an example

Installing the GNOME desktop environment

Yum Groupinstall "X Window System" "Desktop"

CentOS Install XFCE desktop environment, optional

Yum Groupinstall XFCE

Install Tigervnc

Yum Install Tigervnc-server Tigervnc

Set up a remote login to the GNOME desktop configuration, and then add the following two lines to the final side:

Vim/etc/sysconfig/vncservers

vncservers= "1:root"
vncserverargs[1]= "-geometry 1024x768-alwaysshared-depth 24"

Modify Remote Desktop Display profile: Modify to the following and save

Vim/root/.vnc/xstartup

#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset session_manager
exec/etc/x11/xinit/ XINITRC
[-x/etc/vnc/xstartup] && exec/etc/vnc/xstartup
[-R $HOME/. Xresources] && Xrdb $HOME/. Xresources
xsetroot-solid Grey
vncconfig-iconic &
xterm-geometry 80x24+10+10-ls-title "$VNCDESKTOP Desktop "&
gnome-session & #set starting gnome Desktop
#startkde & #kde Desktop
#twm & #Tex T interface
#/usr/bin/startxfce4
#exec/usr/bin/fluxbox

To create a new service, multiple services are built several times, followed by: 1:2: 3, which prompts you to set a password every time you start

Vncserver

Close the specific vncserver command

Vncserver-kill:1
Vncserver-kill:2

power-on Boot

Chkconfig Vncserver on

Firewall settings

When you start the VNC service, you can use the NETSTAT–TUNLP command to view the ports used by VNC services, and you can find 5801,5901,6001. Use the following command to open these ports:
Reboot the firewall:

# NETSTAT–TUNLP
Proto recv-q send-q Local address    Foreign address    State  pid/program name
TCP  0  0 0.0.0.0:5901    0.0.0.0:*     LISTEN  2092/xvnc
tcp  0  0 0.0.0.0:111     0.0.0.0:*     LISTEN  1459/rpcbind
tcp  0  0 0.0.0.0:6001    0.0.0.0:*     LISTEN  2092/xvnc
TCP  0  0 0.0.0.0:22     0.0.0.0:*     LISTEN  1711/sshd
tcp  0  0 127.0.0.1:631    0.0.0.0:*     LISTEN  1557/cupsd
# vim/etc/sysconfig/iptables
-A Rh-firewall-l-input-p tcp-m tcp–dport 5801-j ACCEPT
-A rh-firewall-l-input-p tcp-m tcp–dport 5901-j 8/>-a rh-firewall-l-input-p tcp-m tcp–dport 6001-j ACCEPT
#/etc/init.d/iptables Restart

To install a Windows client:

Http://sourceforge.net/projects/tigervnc/files/latest/download

Start Trigervnc Viewer

Enter the server ip:01, for example: 192.168.1.10:1

Connect to the CentOS desktop by entering the password you set each time you start Vncserver

I hope this article will help you to CentOS server operations.

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.