TigerVNC使用非加密的链接,默认会被firewalld blocked 掉,想要 vnc正常工作就需要让firewalld开放相应的端口才行。

vnc默认的端口号为5900,而每个vnc window的端口号是: 5900+window_number(or,display_number)

如:systemctl start vncserver-username@:2.service  那么这个vnc window的端口号就是 5902

1. Installing VNC Server

~]# yum install tigervnc-server

2. Configuring VNC Server

~#cp /usr/lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
 
2.1 修改配置文件vncserver@:1.service,把USER修改为root

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

2.2 To make the changes take effect immediately, issue the following command:

~]# systemctl daemon-reload

2.3 Set the password for the user or users defined in the configuration file.
~]$ vncpasswd
Password:
Verify:

3. Starting VNC Server

~]# systemctl start vncserver@:1.service
查看端口监听状态:

[root@rusky system]# netstat -an | grep 5901
tcp        0      0 0.0.0.0:5901            0.0.0.0:*               LISTEN    
tcp6       0      0 :::5901                 :::*                    LISTEN

要关闭服务器上的防火墙。

4. 使用VNCViewer客户端连接到VNC服务

IP:端口或是IP: displayNumber

或是使用IP:displayNumber来连接
点击Connect,密码为2.3设置的密码。

二、Configuring VNC Server for Two or more Users

配置多个用户来连接到VNC服务器:

Technorati Tags: linux

1. 复制一份配置文件:vncserver@:2.service

~]# cp vncserver@:1.service vncserver@:2.service

2. 修改配置文件:把Home修改为对应的Username:

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l rusky -c "/usr/bin/vncserver %i"
PIDFile=/home/rusky/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]

3.  切换到rusky用户,并设置vnc密码

[root@rusky ~]# su - rusky
Last login: Wed Nov  2 12:01:47 CST 2016 on pts/0
[rusky@rusky ~]$ vncpasswd
Password:
Verify:

4. 切换回root账号,启动vncserver@:2.service服务

~]# systemctl start vncserver@:2.service

[root@rusky ~]# netstat -an |grep 590*
tcp        0      0 0.0.0.0:5901            0.0.0.0:*               LISTEN    
tcp        0      0 0.0.0.0:5902            0.0.0.0:*               LISTEN    
tcp        0      0 192.168.1.202:5901      192.168.1.100:42832     ESTABLISHED
tcp6       0      0 :::5901                 :::*                    LISTEN    
tcp6       0      0 :::5902                 :::*                    LISTEN

之后,可使用IP:2或IP:5902进行连接

RHEL7安装配置TigerVNC的更多相关文章

  1. RHEL7安装配置VNC

    RHEL7安装配置VNC 作者:Eric 微信:loveoracle11g 安装配置VNC服务程序 [root@zhouwanchun yum.repos.d]# cd ~ [root@zhouwan ...

  2. Linux 环境下安装配置 TigerVNC Server 并启用当前会话远程服务(X0VNC)

    曾经喜欢用 RealVNC Server 实现 Linux/Windows 的远程控制,因为 RealVNC 为收费商业软件,支持文件传输,性能优化方面也做得不错.但 RealVNC 从 5.0 版本 ...

  3. rhel7.3smb安装配置

    rhel7.3smb安装配置 1.安装 yum -y install samba samba-client cifs-utils 2.配置开机自启动,覆盖原配置文件 systemctl enable ...

  4. KVM 虚拟机 安装配置

    原创博文安装配置KVM http://www.cnblogs.com/elvi/p/7718574.htmlweb管理kvm http://www.cnblogs.com/elvi/p/7718582 ...

  5. OPENSTACK在RHEL7安装;admin创建虚拟机模板供demo使用

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/u010026901/article/details/30965601 首先RHEL7安装.导入镜像, ...

  6. RHEL7-openldap安装配置二(客户端安装配置)

    LDAP用户登录流程: 当在客户端输入账号登录系统时,系统根据/etc/nsswitch.conf配置文件获取账号查找顺序,然后再根据PAM配置文件调用相关模块,对账号(/etc/passwd)及密码 ...

  7. RHEL7-openldap安装配置一(服务器端安装配置)

    LDAP的术语:entry:一个单独的单元,使用DN(distinguish name)区别attribute:entry的属性,比如,如果entry是组织机构的话,那么它的属性包括地址,电话,传真号 ...

  8. Graylog安装配置

    ES集群健康检测:curl -sXGET http://localhost:9200/_cluster/health?pretty=true | grep "status" | a ...

  9. centos6.7下安装配置vnc

    vnc是一款使用广泛的服务器管理软件,可以实现图形化管理,下面简单介绍一下如何在centos6.7下安装vnc. 1.安装vncserver yum install tigervnc tigervnc ...

随机推荐

  1. iOS 图片转NSData-b

    iOS开发中 UIImage可能经常需要转为NSData 上传 传递等等 有两个比较常用的方法 UIImageJPEGRepresentation UIImagePNGRepresentation 第 ...

  2. 64位Win7下安装并配置Python3的深度学习库:Theano

    注:本文全原创,作者:Noah Zhang  (http://www.cnblogs.com/noahzn/) 这两天在安装Python的深度学习库:Theano.尝试了好多遍,CMake.MinGW ...

  3. SignalR介绍与Asp.net,前台即时通信【转】

    SignalR 是一个asp.net异步库,它提供广播消息到多个client端的机制. SignalR能用来持久客户端与服务端的连接,让我们便于开发一些实时的应用,例如聊天室在线预订系统,股票交易等实 ...

  4. [译]36 Days of Web Testing(六)

    Day 30 Test in situ  真实场景下的测试 为什么? 我十分推崇现场测试,简单讲就是要在你的站点或应用真实使用的场景下进行测试.但随着人口增长,对于"真实场景"的定 ...

  5. redis问题解决

    一, redis的奇葩问题:我使用命令 redis-cli shutdown 关闭redis之后就再也灭洋启动了! 尝试1: 使用命令 sudo /etc/init.d/redis-server st ...

  6. Web Scale IT 与 6 种 DevOps 工具

    新年伊始,在总结过去一年 IT 行业变化和发展的同时,不少企业更关注未来一年甚至几年的行业趋势.Gartner 于 2014 年发表了文章 Gartner Says By 2017 Web-Scale ...

  7. Android 对话框弹出位置和透明度

    在Android中我们经常会用AlertDialog来显示对话框.通过这个对话框是显示在屏幕中心的.但在某些程序中,要求对话框可以显示在不同的位置.例如,屏幕的上方或下方.要实现这种效果.就需要获得对 ...

  8. Java多线程同步方法Synchronized和volatile

    11 同步方法  synchronized – 同时解决了有序性.可见性问题  volatile – 结果可见性问题 12 同步- synchronized synchronized可以在任意对象上加 ...

  9. [LeetCode#261] Graph Valid Tree

    Problem: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair o ...

  10. maya绝招(21--40)

    第21招 将Outliner分成两个 在该视图中如果元素很多的时候,会觉得Outliner不够用,这个时候拖动下侧的底框,就可以分成两栏,这样选择就省事多了. 第22招 运用选择区域,快速选择物体 在 ...