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. go 语言与循环

    package main import "fmt" type Employee struct{name string; age int} func displayName(e *E ...

  2. js将数字转换成大写的人民币表达式

    function changeNumMoneyToChinese(money) { var cnNums = new Array("零", "壹", " ...

  3. www.nygwkt.com

    南京宁阳制冷设备维修有限公司是专业从事厨房空调,http://www.nygwkt.com岗位空调制冷设备设计.制造.安装.改造.维修.保养的专业化公司.在南京享有很高的客户评论. 我们对南京宁阳制冷 ...

  4. Linux内核监控模块-1-驱动模块(LKM)开发(以一个简单的hello world程序为例)

    在上面一篇中介绍到,监控模块要做成一个驱动模块(或者说是可加载模块,LKM),动态的加载到Linux内核中.那么这篇就简单的介绍一下怎样做一个这样的驱动模块.   以简单的hello world程序为 ...

  5. 掌握C++基础

    以下是笔者在ubuntu系统下编译运行通过的一些反应c++基础特性的例子,包括类,结构体,构造函数,析构函数,函数的重载,this指针,类的继承,虚函数,函数的覆盖和隐藏等.(由于格式问题代码中的乱码 ...

  6. spm使用之三spm应用实例

    spm 的init实际上是调用了grunt这个工具来实现一些交互式的提问和数据的获取. 看看npm就知道, npm有个命令叫init, 就是一样的交互式提问获取你要创建的nodejs的模块信息. sp ...

  7. bzoj 1257: [CQOI2007]余数之和sum 数学 && 枚举

    1257: [CQOI2007]余数之和sum Time Limit: 5 Sec  Memory Limit: 162 MBSubmit: 1779  Solved: 823[Submit][Sta ...

  8. Servo: The Embeddable Browser Engine

    Embedding, in the context of this article, is the process of hosting a web rendering engine inside a ...

  9. java cpu缓存

    众所周知, CPU是计算机的大脑, 它负责执行程序的指令; 内存负责存数据, 包括程序自身数据. 同样大家都知道, 内存比CPU慢很多. 其实在30年前, CPU的频率和内存总线的频率在同一个级别, ...

  10. 14.6.7 Configuring the Number of Background InnoDB IO Threads 配置InnoDB IO Threads的数量

    14.6.7 Configuring the Number of Background InnoDB IO Threads 配置InnoDB IO Threads的数量 InnoDB 使用后台线程来服 ...