How to Install and Configure a VNC Server on RedHat Enterprise Linux (RHEL) 6

时间:2023-01-13 00:31:21

http://www.dell.com/support/article/us/en/19/SLN283098/EN

Article Summary: This article provides information on how to install and configure a VNC server on RedHat Enterprise Linux (RHEL) 6.


Table of Contents:

1. Installation
2. Configure VNC password for the user(s)
3. Configure resolution for the user(s)
4. Start the VNC server
5. Configure firewall


1. Installation of the software


2. Configure VNC password for the user(s)

  • Switch user to the user you want to use for VNC :
    • # su - vncuser1
NOTE: Replace 'vncuser1' with the correct username
  • Set the VNC password for the user :
  • $ vncpasswd
  • $ exit
  • Repeat for each VNC user as necessary


3. Configure resolution for the user(s)

  • Edit '/etc/sysconfig/vncservers' with your favorite editor
  • Append the following lines :
    • VNCSERVERS="1:vncuser1 2:vncuser2"
    • VNCSERVERARGS[1]="-geometry 1024x768"
    • VNCSERVERARGS[2]="-geometry 1024x768"
NOTE: Replace 'vncuser1' and 'vncuser2' with the correct usernames. You can add more users as needed. In addition, you can change the resolution value as needed.


4. Start the VNC server

  • Start the service :
    • # service vncserver start
  • Ensure service is started on reboots :
  • # chkconfig vncserver on


5. Configure the firewall

  • # iptables -I INPUT -m state --state NEW -p tcp --destination-port 5901 -j ACCEPT
  • # iptables -I INPUT -m state --state NEW -p tcp --destination-port 5902 -j ACCEPT
NOTE : Each user requires an additional firewall port opened starting at 5901. Because we added two users above, we need to open two ports.
  • # service iptables save
Other related articles:

http://tecadmin.net/setup-vnc-server-on-centos-redhat-and-fedora/

https://support.godaddy.com/help/article/6012/setting-up-desktop-access-for-your-centos-or-fedora-linux-dedicated-server


On REHL7

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/ch-TigerVNC.html#sec-vnc-server