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

  1. ~]# yum install tigervnc-server

2. Configuring VNC Server

~#cp /usr/lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
  1.  
  1. 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

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

[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

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

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

IP:端口或是IP: displayNumber

  1. 或是使用IP:displayNumber来连接
  1. 点击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. 重启iis线程池和iis站点

    服务器监控. 一定时间内或者iis异常,就重启线程池和站点 一般重启站点没啥用.. 重启线程池 效果明显. 重启站点: /// <summary> /// 根据名字重启站点.(没重启线程池 ...

  2. nutch-1.7-二次开发-Content中增加编码

    1 识别nutch-1.7的编码,完成 以前1.2是在 org.apache.nutch.parse.html.HtmlParser EncodingDetector detector = new E ...

  3. 短信验证码js实现

    短信验证码实现 我们在使用移动.电信等运营商网上营业厅的时候,为确保业务的完整和正确性,经常会需要用到短信的验证码.最近因为某省业务需要,也做了个类似的功能. 原理很简单,就是在用户点击"获 ...

  4. configure: error: cannot find protoc, the Protocol Buffers compiler

    centos 6 安装mosh 1.2 2012-05-07 17:21:41标签:centos mosh 关于mosh(引用于) 芬兰研究员Tatu Ylönen于1995年设计出最早的SSH协议, ...

  5. bzoj1236

    其实这道题目不难,主要要求我们有一个清晰地思路首先可以按位数讨论,这里我把1~9单独讨论了因为除了1位数,每个位数开头的数的开头数字1前面都是-号然后考虑位数的奇偶性当位数为奇数的时候比较简单举个例子 ...

  6. 在多台服务器上简单实现Redis的数据主从复制

          Redis的主从复制功能非常强大,一个master可以拥有多个slave,而一个slave又可以拥有多个slave,如此下去,形成了强大的多级服务器集群架构.下面我演示下怎样在多台服务器上 ...

  7. Socket Class中文解释

    Socket 类 .NET Framework 4.6 and 4.5 实现 Berkeley 套接字接口. 继承层次结构   System.Object   System.Net.Sockets.S ...

  8. Delphi 用Web App Debugger简单调试ISAPI 转

    用Web App Debugger简单调试ISAPI   以isapi为例: 1.新建一个project,用isapi/nsapi: 2.remove这个project中所有的unit: 3.加进你用 ...

  9. HDU-4952 Number Transformation

    http://acm.hdu.edu.cn/showproblem.php?pid=4952 Number Transformation Time Limit: 2000/1000 MS (Java/ ...

  10. 阻止iOS设备锁屏

            [[UIApplicationsharedApplication] setIdleTimerDisabled: YES];