Centos Config X11vnc Service Toturial

This article I will show you, tools which enabled you to access remote Desktop on machines running Centos/RHEL.

Before beginning, you only need SSH access to your server and rights to install software. You need to know root password or permissions to use sudo. All commands will work on every CentOS server 5/6/7. Before start, you need to install desktop environment to your server.

Installing GNOME Desktop environment

GNOME is the most popular environment in the latest distributions of Linux. It's the default environment in CentOS 7 GUI, Fedora 21 and later and Ubuntu 17.10.

To install GNOME Desktop run the following commands.

# yum -y groups install "GNOME Desktop"

After the installation run the command below to start the GNOME environment.

#startx

The GNOME environment will start thereafter. After a reboot, The GNOME setup will prompt you to set up the following parameters.

  • System Language
  • Keyboard type
  • System Language
  • Online Accounts
  • System Language

Finally, click on Start using CentOs 7. The default GNOME Desktop is the GNOME Classic. If you prefer to use the GNOME shell, type the following command before the startx command.

#echo "exec gnome-session" >> ~/.xinitrc
#startx

Alternatively, after a reboot, you can select your preferred environment at the login screen.

After startx, next, follow these steps.

#yum groupinstall 'GNOME Desktop Environment' 'X Window System'

x11vnc – simples of this 3 methods to get remote access. VNC stands for Virtual Network Computing) is a very useful network graphics protocol.

Perhaps you need to enable EPEL (Extra Packages for Enterprise Linux) repository. Run

#yum -y install epel-release

Now we can install x11vnc. This command will install server and solve all dependencies.

#yum -y install x11vnc

Setting x11vnc passwd and then we will protect server with password.

# x11vnc passwd
# x11vnc -storepasswd /etc/x11vnc.pass

Config DM script ,for example gdm.

#vi /etc/gdm/Init/Default

Add the following content.

/usr/bin/x11vnc -nap -bg -many -repeat -clear_keys -rfbauth /etc/x11vnc.pass -rfbport 5900

Add / edit KillInitClients option in the [daemon] section to:add new line before exit(0).

#vi /etc/gdm/custom.conf
KillInitClients=false

whichever returns a value is the one you a running.  CentOS7's default firewall is not iptables, but firewalle. You need to install iptable-service.

//First check to see if iptables is installed
#service iptables status
 
//Install iptables
#yum install -y iptables
 
//Update iptables
#yum update iptables 
 
//Install iptables-services
#yum install iptables-services

Disable/stop the firewalld service that comes with firewalld.

#systemctl stop firewalld
#systemctl mask firewalld

Now, config iptables.

#iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 5900 -j ACCEPT 
#service iptables save
#service iptables restart

Reboot the machine, all complete, enjoy!

More detail,please click here:5 Tools to Enable Remote Desktop Access on RHEL/CentOS 7

reference links:

https://www.robhq.com/2017/09/x11vnc-with-redhat-centos-7/

https://linoxide.com/linux-how-to/install-configure-vnc-server-centos-7-0

How to Install and Configure VNC Server on CentOS 7

你可能感兴趣的:(Centos Config X11vnc Service Toturial)