一,安装tigervnc-server VNC软件包

[root@localhost ~]# yum install tigervnc-server

设置开机自启动
[root@localhost ~]# chkconfig --level 35 vncserver on
查看配置文件所在位置

[root@localhost ~]# rpm -qc tigervnc-server
/etc/sysconfig/vncservers
 
二.目的:以vistor用户启动第一个端口,即5901,以student用户启动第二个端口,即5902
[root@localhost ~]# vim /etc/sysconfig/vncservers
VNCSERVERS="1:visitor 2:student"
VNCSERVERARGS[1]="-geometry 1400x900 -nolisten tcp -localhost
VNCSERVERARGS[2]="-geometry 1400x900 -nolisten tcp -localhost
以vnc使用用户登录系统,创建vnc密码,vncpasswd
[root@localhost ~]# su - visitor
[visitor@localhost ~]$ vncpasswd
Password: 输入密码
Password must be at least 6 characters - try again
Password: 再次输入密码
Verify:
启动服务一次,生成 /home/visitor/.vnc/xstartup
[visitor@localhost ~]$ vncserver 
 
New 'localhost.localdomain:1 (visitor)' desktop is localhost.localdomain:1
 
Starting applications specified in /home/visitor/.vnc/xstartup
Log file is /home/visitor/.vnc/localhost.localdomain:1.log
查看已经打开的vnc服务,关闭服务
[visitor@localhost ~]$ vncserver -list
 
TigerVNC server sessions:
 
X DISPLAY #     PROCESS ID
:1              5567
[visitor@localhost ~]$ vncserver -kill :1
Killing Xvnc process ID 5567
[visitor@localhost ~]$ exit
logout
[root@localhost ~]# su - student
[student@localhost ~]$ vncpasswd 
Password:
Verify:
[student@localhost ~]$ vncserver 
xauth:  creating new authority file /home/student/.Xauthority
 
New 'localhost.localdomain:1 (student)' desktop is localhost.localdomain:1
 
Creating default startup script /home/student/.vnc/xstartup
Starting applications specified in /home/student/.vnc/xstartup
Log file is /home/student/.vnc/localhost.localdomain:1.log
 
[student@localhost ~]$ vncserver -list
 
TigerVNC server sessions:
 
X DISPLAY #     PROCESS ID
:1              8764
[student@localhost ~]$ vncserver -kill :1
Killing Xvnc process ID 8764
[student@localhost ~]$ exit
logout
 
 
三,启动服务
[root@localhost ~]# /etc/init.d/vncserver start
正在启动 VNC 服务器:1:visitor 
New 'localhost.localdomain:1 (visitor)' desktop is localhost.localdomain:1
 
Starting applications specified in /home/visitor/.vnc/xstartup
Log file is /home/visitor/.vnc/localhost.localdomain:1.log
 
2:student 
New 'localhost.localdomain:2 (student)' desktop is localhost.localdomain:2
 
Starting applications specified in /home/student/.vnc/xstartup
Log file is /home/student/.vnc/localhost.localdomain:2.log
 
                                                           [确定]
四.添加防火墙配置
[root@localhost ~]# vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT
[root@localhost ~]# service iptables restart
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]
 
五.远程访问
 
六.使用安全的SSH进行连接
 
VNC 是明文的,不安全的.连接过程可能会被窃听,干扰.可以使用SSH通道加密,然后再由远程主机的回环地址通信,加大了安全性.
[root@localhost ~]# vim /etc/sysconfig/vncservers
VNCSERVERARGS[1]="-localhost"
 
[11:30:18 talen@BJB0300 ~ ]$ vncviewer -via visitor@172.31.0.128 localhost:1
这里的localhost是远程主机的回环地址,由远程主机解析
 
七.生成密码文件,无输入密码登录
[root@localhost ~]# vncpasswd virtual
Password:
Verify:
[13:43:02 talen@BJB0300 study ]$ vncviewer -passwd ~/study/virtual -via root@172.31.0.128 localhost:3
 
八.多用户配置
 
 VNCSERVERS="3:root 2:student"
 VNCSERVERARGS[2]="-geometry 800x600 -localhost"
 VNCSERVERARGS[3]="-geometry 1024x768 -localhost"
 
 

VNC的安装与配置的更多相关文章

  1. 【VNC】Linux环境VNC服务安装、配置与使用

     [VNC]Linux环境VNC服务安装.配置与使用 2009-06-25 15:55:31 分类: Linux   前言:作为一名DBA,在创建Oracle数据库的过程中一般要使用dbca和netc ...

  2. Linux环境VNC服务安装、配置与使用

    前言:作为一名DBA,在创建Oracle数据库的过程中一般要使用dbca和netca图像化进行建库和创建监听(如果使用脚本建库另说),如果您身体好估计可以在瑟瑟发抖的机房中完成数据库的创建过程,由于本 ...

  3. 【一步一步走(1)】远程桌面软件VNC的安装与配置

    近期在VPS上搭建Python Web环境.走了非常多弯路,借此记下. 先说说购买的VPS(PhotonVPS),我可不是打广告.仅仅是感觉这个VPS服务提供商还不错推荐给你大家,我之前也是体验过阿里 ...

  4. VNC服务安装、配置与使用

    原帖地址: http://blog.itpub.net/519536/viewspace-607549/ 该文档配置环境是RHEL,不同系统可能会有差别,本人测试过centos,ubuntu 1.确认 ...

  5. VNC的安装和配置

    服务端环境:CentOS 6.7 客户端环境:Windows 7 1.服务器安装VNC服务端 2.编辑vnc配置文件 3.设定VNC的密码 4.查看vnc的会话信息 5.客户端测试vnc连接 Refe ...

  6. centOS学习part3:远程工具VNC的安装与配置

    0 上一篇(http://www.cnblogs.com/souvenir/p/3875484.html)我们介绍了通过yum安装JDK的实例,初步见识了yum命令的强大.本章我们将继续使用yum命令 ...

  7. ubuntu中VNC的安装配置笔记

    使用服务器时,利用远程桌面是非常方便的,否则需要跑到服务器机房操作非常的费事,或者需要远程操作机器是也可以使用,一般的操作系统都会带有远程桌面功能,但是不如第三方的的软件好用,对于linux系统常用的 ...

  8. Linux VNC server 安装配置

    1.安装vnc server [root@pxe ~]# yum install tigervnc-server -y   2.设置 vnc server 开机启动 [root@pxe ~]# chk ...

  9. 怎样在 CentOS 7.0 上安装和配置 VNC 服务器

    这是一个关于怎样在你的 CentOS 7 上安装配置 VNC 服务的教程.当然这个教程也适合 RHEL 7 .在这个教程里,我们将学习什么是 VNC 以及怎样在 CentOS 7 上安装配置 VNC ...

随机推荐

  1. android 比较靠谱的图片压缩

    第一:我们先看下质量压缩方法: private Bitmap compressImage(Bitmap image) { ByteArrayOutputStream baos = new ByteAr ...

  2. GPS定位原理

    多分钟吧(有人认为美国对其本土覆盖的GPS信号实行不同码率因此纯GPS定位也会很快,谁有美国朋友不妨让他拔卡试试)!因为美版机型其GPS模块的数据处理软件部分与欧版机型是不同的,欧版机型的数据处理软件 ...

  3. sql语句返回主键SCOPE_IDENTITY()

    在sql语句后使用 SCOPE_IDENTITY() 当然您也可以使用 SELECT @@IDENTITY 但是使用 SELECT @@IDENTITY是去全局最新. 有可能取得值不正确. 示例:in ...

  4. Accepted Necklace

    Accepted Necklace Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) T ...

  5. vi编辑文件E437: terminal capability "cm" required 解决办法

    E437: terminal capability "cm" required 这个错误一般是环境变量TERM没有配置或者配置错误所致. 解决办法: 执行export TERM=x ...

  6. yum mysql on centos 7

    参考:https://www.linode.com/docs/databases/mysql/how-to-install-mysql-on-centos-7 centos 7上没有办法使用yum i ...

  7. InheritableThreadLocal原理

    转载:https://github.com/pzxwhc/MineKnowContainer/issues/20 介绍 InheritableThreadLocal 之前,假设对 ThreadLoca ...

  8. 操作SQLite的dbhelper

    操作SQLite的dbhelper public class DbHelper { string connStr = @"Data Source=" + System.Enviro ...

  9. 在 Server 端存取 Excel 檔案的利器:NPOI Library

    转处 http://msdn.microsoft.com/zh-tw/ee818993.aspx Codeplex 軟體套件(Package)資訊 套件名稱 NPOI 作者 tonyqus, huse ...

  10. Linux下新的网络管理工具ip替代ifconfig零压力

    如果你使用 Linux 足够久,那么你自然知道一些工具的来与去.2009年 Debian 开发者邮件列表宣布放弃使用缺乏维护的 net-tools 工具包正是如此.到今天 net-tools 仍然被部 ...