1.在vncserver设置登录用户的信息
 
#vi /etc/sysconfig/vncservers
 
VNCSERVERS="1:root 2:wt"
此处添加用户
 
VNCSERVERARGS[2]="-geometry 1280x1024-alwaysshared
#vncserver -geometry 1280x1024
设置vncserver的分辨率
#vncserver -geometry 1280x1024
设置vncserver的分辨率
#vncserver -depth 8
设置vncserver的色深
#vncserver -depth 16
设置vncserver的色深
注意:-geometry 1024x768表示分辨率;-alwaysshared 表示允许多终端同时登陆
 
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see this URL:
# http://kbase.redhat.com/faq/docs/DOC-7028 # Use "-nolisten tcp" to prevent X connections to your VNC server via TCP. # Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
VNCSERVERS="1:root 2:wt"
VNCSERVERARGS[]="-geometry 1280X1024"
VNCSERVERARGS[]="-geometry 1280X1024 -alwaysshared"
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[]="-geometry 800x600 -nolisten tcp -localhost"
2. 切换到vnc登录中使用用户,然后配置密码,
 
root@localhost /]#su wt
[huilin@localhost /]$ vncserver :2
You will require a password to access your desktops.
Password: 输入vnc 连接密码
Verify: 确认vnc密码
xauth: creating new authority file /home/huilin/.Xauthority
New 'localhost.localdomain:2 (huilin)' desktop is localhost.localdomain:2
Creating default startup script /home/huilin/.vnc/xstartup
Starting applications specified in /home/huilin/.vnc/xstartup
Log file is /home/huilin/.vnc/localhost.localdomain:2.log

* 注意到每个用户都可以启动自己的 vncserver,每个用户可以启动多个 vncserver,

用ip加端口号 ip:1,ip:2,ip:3 来标识。vncserver的大部分配置文件及日志文件都在用户home目录下.vnc目录下
用户可以自定义启动号码如:
[huilin@localhost /]$ vncserver  
A VNC server is already running as :1

3、打开对应的端口

打开5901至5902 端口用于vnc  //如果需要配置更多的桌面,增加端口即可
iptables -I INPUT -p tcp --dport 5901:5902 -j ACCEPT
iptables -A INPUT -p tcp --dport 5901:5902 -j ACCEPT
永久保存
service iptables save

4.启动vncserver服务
1)启动全部桌面
   service vncserver start 
2)启动某一桌面
   vncserver :1   //这里1表示第一个桌面

5、停止vncserver服务

1)停止全部桌面
   service vncserver stop
2) 停止某一桌面
    vncserver -kill :1   //停止第1个界面,要用kill命令来杀掉界面1的进程

6、查看当前有几个桌面在运行

service vncserver status

7、让vncserver服务随机启动

默认状态下,vncserver服务不是开机自动启动,需要手工启动。
chkconfig --list vncserver
chkconfig vncserver on
保存后,重启测试。

8.客户端登录vncserver服务

(1)先安装vncviewer来远程登录,

(2)然后在地址栏输入“主机地址:1”(即主机IP加界面号的方式)

vncserver 添加用户的更多相关文章

  1. IdentityServer4 使用OpenID Connect添加用户身份验证

    使用IdentityServer4 实现OpenID Connect服务端,添加用户身份验证.客户端调用,实现授权. IdentityServer4 目前已更新至1.0 版,在之前的文章中有所介绍.I ...

  2. [CentOs7]搭建ftp服务器(2)——添加用户

    摘要 上篇文章完成了ftp服务器的安装与匿名访问的内容,当然出于安全的考虑是不允许匿名访问服务器的,所以就有了本篇的内容 ,为ftp服务器添加用户,用改用户进行访问. vsftpd添加用户 FTP用户 ...

  3. sh3.useradd 添加用户脚本

    1.写一个脚本: 添加10个用户user1到user10,密码同用户名,但要求只有用户不存在的情况下才能添加 #/bin/bash # ..};do if id user$i &> /d ...

  4. MySQL添加用户、删除用户与授权

    MySql中添加用户,新建数据库,用户授权,删除用户,修改密码(注意每行后边都跟个;表示一个命令语句结束): 1.新建用户 1.1 登录MYSQL: @>mysql -u root -p @&g ...

  5. ftp 服务器搭建和添加用户和目录

    安装: yum install  -y vsftpd 修改配置: vsftpd.conf 修改:anonymous_enable=YES 改为:anonymous_enable=NO 启动/停止/重启 ...

  6. SharePoint 2013 表单认证使用ASP.Net配置工具添加用户

    前 言 上面一篇博客,我们了解到如何为SharePoint 2013配置表单身份认证,但是添加用户是一个麻烦事儿:其实,我们还可以用Asp.Net的配置工具,为SharePoint 2013添加表单用 ...

  7. MySql安装与MySQL添加用户、删除用户与授权

    1.安装MySql       目前MySQL有两种形式的文件,一个是msi格式,一个是zip格式的.msi格式的直接点击setup.exe就好,按照步骤进行.但是很多人下了zip格式的解压发现没有s ...

  8. linux 添加用户、权限

    # useradd –d /usr/sam -m sam 此命令创建了一个用户sam,其中-d和-m选项用来为登录名sam产生一个主目录/usr/sam(/usr为默认的用户主目录所在的父目录). 假 ...

  9. 2------------NLPIR(ICTCLAS2016)分词系统添加用户词典功能

    备注:win7 64位系统,netbeans编程 基本代码框架参见我的另一篇文章:NLPIR分词功能 代码实现: package cwordseg; import java.io.Unsupporte ...

随机推荐

  1. HttpClient(4.3.5) - Redirect Handling

    HttpClient handles all types of redirects automatically, except those explicitly prohibited by the H ...

  2. jQuery之渐变切换

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  3. mysql 游标嵌套循环实例

    BEGIN #Routine body goes here... ####所有的2个小时之前生成的待支付订单更新为已过期 DECLARE tmp_id INT; DECLARE tmp_order_i ...

  4. 【Android学习】调用系统相机

    Android调用系统相机分三步走: 首先是要设置调用相机的权限. 其次是给按钮加打开相机的事件. 最后是拍照后进行图片的保存. 第一步,添加权限: <!-- 调用系统相机 --> < ...

  5. MySQL查询不使用索引汇总

    众所周知,增加索引是提高查询仍然不使用索引,这种情况严重影响性能,这里就简单总结几条如果如果列key均匀分布在1和100之间,下面的查询使用索引就不是很好:select * from table_na ...

  6. sql语句聚合等疑难问题收集

    ------------------------------------------------------------------------------------ 除法运算 select 500 ...

  7. (转)SQLSERVER表分区的介绍(一)

    下面进入正题吧,很多时候当单张数据表的数据量比较大的时候比如千万级别条记录.上亿级别记录,如果不做优化,那么查询的效率大家清楚. 有经验的人会通过各种手段做优化,其中表分区就是其中一种手段. 个人对表 ...

  8. NTT研发

    2.研发标准 stead---大型机 css terasolunt---反向自动生成设计书 3.开发阶段做好设计,确定需求,测试阶段只是做产品有多差或者完成了多少需求,不是用来提高产品质量的过程

  9. 基数排序(RadixSort)

    1 基数排序的特点是研究多个关键字key,且多个key之间有权重之分,    或者可把单个key建模为含有多个key的排序 而计数排序.桶排序始终只有个一个key,或者说围绕着一个比较规则 Ex:比较 ...

  10. 关于AjaxPro的用法

    1.添加引用AjaxPro.2.dll到项目中 2.添加webconfig iis6添加 在<system.web>中添加: <httpHandlers> <add ve ...