一,安装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. Greenplum迁移到配置不同的GP系统

    要使用gp_restore或gpdbrestore并行恢复操作,恢复的系统必须与备份的系统具有相同的配置(相同数量的Instance).如果想要恢复数据库对象和数据到配置不同的系统(比如系统扩展了更多 ...

  2. java double类型保留两位小数4种方法【转】

    4种方法,都是四舍五入,例: import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.NumberF ...

  3. 杭电1005-Number Sequence

    问题描述 A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2) ...

  4. python爬虫之Scrapy 使用代理配置

    转载自:http://www.python_tab.com/html/2014/pythonweb_0326/724.html 在爬取网站内容的时候,最常遇到的问题是:网站对IP有限制,会有防抓取功能 ...

  5. MVC2.0==>MVC3.0

    总结出如下4个MVC3.0和2.0的重要区别. 1. @ 符号在 View 页面中的用法: C#代码以 @符号开头,例如 1 <h2>Name: @Model.Name</h2> ...

  6. Intent官方教程(2)Intent的两种类型

    Intent Types There are two types of intents: Explicit intents specify the component to start by name ...

  7. SaveXml的方法汇总

    /// <summary> /// 保存XML文件 /// </summary> /// <returns></returns> public bool ...

  8. 11个让你吃惊的 Linux 终端命令

    原文:http://linux.about.com/od/commands/tp/11-Linux-Terminal-Commands-That-Will-Rock-Your-World.htm 作者 ...

  9. 从exchange2010上面删除特定主题或特定时间的邮件

    昨天在上班的公交上接到同事电话,说他的的部门老大发错了一封邮件到另外一个同事邮箱了,问我能不 能去那个同事的邮箱里面删除,我一想,之前在网上看到过资料,到了公司趁那个误接收邮件的同事还没有来,在服务器 ...

  10. UVA 437 十九 The Tower of Babylon

    The Tower of Babylon Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Subm ...