一,安装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. Oracle性能优化--DBMS_PROFILER

      想看到过程或者函数执行每一步的过程:想看到每一步所占的时间吗?借助profiler吧:它可以满足你来分析过程/函数执行比较久:可以直接快速找到病因:从而可以优化那一步需要优化下.        一 ...

  2. shareSDK集成步骤

    按下面目录结构吧sdk的目录文件拷贝到自己的工程中 针对各个平台的分享格式,整理成了一个工具类,不同的平台分享的参数http://wiki.mob.com/不同平台分享内容的详细说明/ package ...

  3. javascript 中==和===的区别

        对于JavaScript中比较运算符,可能大家用的比较多的是“==”.对于“===”很多人可能很陌生.=== 表示恒等,首先比较两边的变量数据类型是否相等,其次比较两边的变量的数值是否相等:= ...

  4. Xcode中设置按钮在十分钟之内禁用

    btn.enabled=NO;` NSTimer * notificationTimer = [NSTimer scheduledTimerWithTimeInterval:10*60.0 targe ...

  5. 理解mipi协议

    完成mipi信号通道分配后,需要生成与物理层对接的时序.同步信号: MIPI规定,传输过程中,包内是200mV.包间以及包启动和包结束时是1.2V,两种不同的电压摆幅,需要两组不同的LVDS驱动电路在 ...

  6. 方法参数out

    using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace _050505 ...

  7. BZOJ3687:bitset STL

    [bzoj3687][FJ2014集训]简单题 2014年9月14日1,8212 [题目描述]小呆开始研究集合论了,他提出了关于一个数集四个问题:1. 子集的异或和的算术和.2. 子集的异或和的异或和 ...

  8. JDBC批量处理

    转载自http://www.cnblogs.com/xdp-gacl/p/3983253.html 在实际的项目开发中,有时候需要向数据库发送一批SQL语句执行,这时应避免向数据库一条条的发送执行,而 ...

  9. 【leetcode❤python】Ransom Note

    #-*- coding: UTF-8 -*- class Solution(object):       def canConstruct(self, ransomNote, magazine):   ...

  10. UVA 1456 六 Cellular Network

    Cellular Network Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit S ...