Install TightVNC Server in RHEL/CentOS and Fedora to Access Remote Desktops

Virtual Networking Computing (VNC) is a Kind of remote sharing system that makes it possible to take control of any other computer connected to internet. Keyboard and mouse clicks can easily transmit from one computer to another. It helps administrator and technical staff to manage their servers and desktops without being to the same location physically.

VNC is an open source application created in late 1990′s. It is independent and is compatible with Windows and Unix/Linux. Means a normal Windows based user can interact with Linux based system without any hazel.

To use VNC you must have TCP/IP connection and VNC viewer client to connect to a computer running VNC server component. The server transmits a duplicate display of a remote computer to the viewer.

This artilce demonstrates how to install VNC Server using TightVNC a much enhanced version of a older VNC program, with GNOME Desktop remote access on RHELCentOS andFedora systems.

Step 1: Installing GNOME Desktop

If you’ve installed a minimal version of Operating System, which gives only a command-line interface not GUI. Then you need to install a GUI (Graphical User Interface) withGNOME Desktop. The GNOME desktop provides a lightweight desktop environment that works very well on remote VNC desktops.

[root@tecmint ~]# yum groupinstall "X Window System" "Desktop"

Step 2: Installing TightVNC Server

TightVNC a remote desktop control software that enables us to connect to remote desktops. To install, use the following yum command as shown below.

[root@tecmint ~]# yum -y install tigervnc-server xorg-x11-fonts-Type1

Step 3: Create a Normal VNC User

Create a normal user, that will be used to connect to remote desktop. For example, I’ve used “tecmint” as a user, you can choose your own username.

[root@tecmint ~]# useradd tecmint
[root@tecmint ~]# passwd tecmint
Changing password for user tecmint.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

Step 4: Set VNC Password for User

Create a new password for newly created user. Login to the user (su – tecmint) and run ‘vncpasswd‘ to set the VNC password for the user.

Note : This password is for accessing VNC remote desktop, and the password we created instep 3 is for accessing SSH.

[root@tecmint ~]# su - tecmint
[tecmint@tecmint ~]$ vncpasswd
Password:
Verify:

The above command ask you to supply password twice and creates “.vnc” directory under user’s home directory with passwd file inside it. You can check the password file is created, by using following command.

# ls -l /home/tecmint/.vnc
-rw------- 1 tecmint tecmint 8 Jul 14 21:33 passwd

Now exit from user login and return to root user login.

[tecmint@tecmint ~]$ exit
exit

Step 5: Create VNC Xstartup Script

Create the xstartup script as root user. This can be created by starting the VNC server.

[root@tecmint ~]# /etc/init.d/vncserver start

Starting VNC server: 1:tecmint
New 'tecmint.com:1 (tecmint)' desktop is tecmint.com:1

Starting applications specified in /home/tecmint/.vnc/xstartup
Log file is /home/tecmint/.vnc/tecmint.com:1.log
						 [  OK  ]

Next, check whether xstartup script is created under (tecmint) user’s home directory, do “ls -l” command.

[root@tecmint ~]# ls -l /home/tecmint/.vnc/
-rw-------. 1 tecmint tecmint    8 Jul 15 12:27 passwd
-rwxr-xr-x. 1 tecmint tecmint  654 Oct 11  2012 xstartup

Once, it created,  set a desktop resolution in xstartup file. For this, you must stop running VNC service.

[root@tecmint ~]# /etc/init.d/vncserver stop

Shutting down VNC server: 1:tecmint              [  OK  ]

Step 6: Setting Xstarup Resolution

Open file “/etc/sysconfig/vncservers” file your choice of editor. Here I’m using “nano” editor.  Create new VNC Session for “tecmint” with below command. where “-geomerty” is used define desktop resolution.

[root@tecmint ~]# nano /etc/sysconfig/vncservers

And add following lines to it at the bottom of file. Save and close it.

## Single User ##
VNCSERVERS="1:tecmint"
VNCSERVERARGS[1]="-geometry 1280x1024"

If you’re dealing with multiple users, first create a vncpasswd for all user’s as described above in step 4, and then add those user’s to the VNCSERVERS line and add aVNCSERVERARGS[x] entry as shown below. Where ‘x‘ is the ID number.

## Multiple Users ##
VNCSERVERS="2:ravi 3:navin 4:avishek"
VNCSERVERARGS[2]="-geometry 1280x1024"
VNCSERVERARGS[3]="-geometry 1280x1024"
VNCSERVERARGS[4]="-geometry 1280x1024"

Step 7: Starting TightVNC Server

After making all changes, run the following command to start again the VNC server. Before starting VNC session to “tecmint” user, let me give you a small intro about Port Numbers and ID‘s. By Default VNC runs on Port 5900 and ID:0 (which is for root user). In our scenario I’ve created tecmintravinavin and avishek. So, the ports andid’s are used by these users as follows

User's		Port's		ID's
5900		root		:0
5901		tecmint		:1
5902		ravi		:2
5903		navin		:3
5904		avishek		:4

So, here user “tecmint” will get port 5901 and id as :1 and so on. If you’ve created another user say (user5) then he will get port 5905 and id:5 and so on for each user you creates.

[root@tecmint ~]# /etc/init.d/vncserver start

Starting VNC server: 1:tecmint
New 'tecmint.com:1 (tecmint)' desktop is tecmint.com:1

Starting applications specified in /home/tecmint/.vnc/xstartup
Log file is /home/tecmint/.vnc/tecmint.com:1.log

2:ravi
New 'tecmint.com:2 (ravi)' desktop is tecmint.com:2

Starting applications specified in /home/ravi/.vnc/xstartup
Log file is /home/ravi/.vnc/tecmint.com:2.log

3:navin
New 'tecmint.com:3 (navin)' desktop is tecmint.com:3

Starting applications specified in /home/navin/.vnc/xstartup
Log file is /home/navin/.vnc/tecmint.com:3.log

4:avishek
New 'tecmint.com:4 (avishek)' desktop is tecmint.com:4

Starting applications specified in /home/avishek/.vnc/xstartup
Log file is /home/avishek/.vnc/tecmint.com:4.log

                                                           [  OK  ]

Step 8: Open VNC Ports on Firewall

Open port on iptables, say for user (tecmint) at 5901.

[root@tecmint ~]# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT

For multiple users, ravinavin and avishek. I open ports 59025903 and 5904respectively.

[root@tecmint ~]# iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp -m multiport --dports 5902:5904 -j ACCEPT

Restart Iptables service.

[root@tecmint ~]# service iptables save
[root@tecmint ~]# service iptables restart

Step 9: Download VNC Client

Now go to your Windows or Linux machine and download VNC Viewer client and install in your system to access the desktop.

  1. Download VNC Viewer

Step 10: Connect to Remote Desktop Using Client

After you installed the VNC Viewer client, open it you’ll get similar to below screen. Enter VNC Server IP address along with VNC ID (i.e 1) for user tecmint.



 

Enter VNC Server IP Address

Enter password that we created with “vncpasswd” command.



 

Enter VNC User Password

That’s it, you connected to your Remote Desktop.



 

VNC Remote Desktop

Read Also : Access VNC Desktop from Web Browser

 

from:http://www.tecmint.com/install-tightvnc-remote-desktop/

时间: 2025-01-11 02:31:31

Install TightVNC Server in RHEL/CentOS and Fedora to Access Remote Desktops的相关文章

How To Install Zabbix Server 3.0 on CentOS/RHEL 7/6/5

Zabbix is an open source software for networks and application monitoring. Zabbix provides agents to monitor remote hosts as well as Zabbix includes support for monitoring via SNMP, TCP and ICMP checks. Click here to know more about zabbix. This arti

在 RHEL、CentOS 及 Fedora 上安装 Drupal 8

Drupal 是一个开源,灵活,高度可拓展和安全的内容管理系统Content Management System(CMS),使用户轻松的创建网站. 它可以使用模块拓展,使用户将内容管理转换为强大的数字解决方案. Drupal 运行在诸如 Apache.IIS.Lighttpd.Cherokee.Nginx 的 Web 服务器上,后端数据库可以使用 MySQL.MongoDB.MariaDB.PostgreSQL.MSSQL Server. 在这篇文章中, 我们会展示在 RHEL 7/6.Cent

如何在RHEL、CentOS及Fedora上安装Drupal 8

Drupal 是一个开源,灵活,高度可拓展和安全的内容管理系统Content Management System(CMS),使用户轻松的创建网站. 它可以使用模块拓展,使用户将内容管理转换为强大的数字解决方案. Drupal 运行在诸如 Apache.IIS.Lighttpd.Cherokee.Nginx 的 Web 服务器上,后端数据库可以使用 MySQL.MongoDB.MariaDB.PostgreSQL.MSSQL Server. 在这篇文章中, 我们会展示在 RHEL 7/6.Cent

RHEL/Centos/Fedora/下搭建vpn pptp 服务器步骤

  用vpn已经有很多年,然而一直因为懒惰原因,所以一直都没有写关于如何搭建vpn服务器的文章,今年兴致所致,分享一下个人搭建vpn server的过程,写的简陋,请勿拍砖.vpn的使用非常广泛,可谓大多网虫和技术股都需要用到的东西,不过看下文之前请先看看自己的服务器是否支持pptp方式的vpn服务器,具体请执行命令 modprobe ppp-compress-18 && echo ok 假如输出ok请继续, 假如不ok,说明服务器不支持.下面的文章可能对你没啥用. 第一步:安装pptpd

为什么我们不允许非root用户在CentOS、Fedora和RHEL上直接运行Docker命令

本文讲的是为什么我们不允许非root用户在CentOS.Fedora和RHEL上直接运行Docker命令,[编者的话]容器技术最大的弱点是安全性不足,Docker也不例外.因此,如何加强Docker的安全性是每一个Docker用户必须慎重考虑的问题.这篇文章介绍了不用sudo而直接运行Docker命令所存在的安全漏洞,并强烈建议通过设置sudo规则作为暂时的解决方法. 我经常会收到用户反馈的Bug,他们问我们『为什么默认情况下不能使用非root用户直接运行Docker命令』. Docker能够将

RHEL/CentOS 7 中配置 PXE 网络启动服务器

RHEL/CentOS 7 中配置 PXE 网络启动服务器 PXE服务器--预启动执行环境--指示客户端计算机直接从网络接口启动.运行或安装操作系统,而不需要烧录CD/DVD或使用某个物理介质,它可以减轻你网络中多台机器同时安装Linux发行版的工作. 在RHEL/CentOS 7中设置PXE网络启动 前置阅读 CentOS 7最小化安装步骤 RHEL 7最小化安装步骤 在RHEL/CentOS 7中配置静态IP地址 移除RHEL/CentOS 7中不要的服务 安装NTP服务器以设置RHEL/C

RHCE 系列(十):在 RHEL/CentOS 7 中设置 NTP(网络时间协议)服务器

RHCE 系列(十):在 RHEL/CentOS 7 中设置 NTP(网络时间协议)服务器 网络时间协议 - NTP - 是运行在传输层 123 号端口的 UDP 协议,它允许计算机通过网络同步准确时间.随着时间的流逝,计算机内部时间会出现漂移,这会导致时间不一致问题,尤其是对于服务器和客户端日志文件,或者你想要复制服务器的资源或数据库. 在 CentOS 和 RHEL 7 上安装 NTP 服务器 前置要求: CentOS 7 安装过程 RHEL 安装过程 额外要求: 注册并启用 RHEL 7

安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情(四)

安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情(四) 17. 安装 Webmin Webmin 是基于 Web 的 Linux 配置工具.它像一个中央系统,用于配置各种系统设置,比如用户.磁盘分配.服务以及 HTTP 服务器.Apache.MySQL 等的配置. # wget http://prdownloads.sourceforge.net/webadmin/webmin-1.740-1.noarch.rpm # rpm -ivh webmin-*.rpm 安装 Webm

在 RHEL/CentOS 7.0 中安装 LAMP

跳过 LAMP 的介绍,因为我认为你们大多数已经知道了.这个教程会集中在如何在升级到 Apache 2.4 的 Red Hat Enterprise Linux 7.0 和 CentOS 7.0 中安装和配置 LAMP:Linux.Apache. MariaDB. PHP/PhpMyAdmin. 在 RHEL/CentOS 7.0 中安装 LAMP 前置要求 根据使用的发行版是 RHEL 还是 CentOS 7.0,按照下面的链接来进行最小化的系统安装,网络使用静态 IP. 对于 RHEL 7.