vncserver 添加用户
#vi /etc/sysconfig/vncservers
# 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"
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 添加用户的更多相关文章
- IdentityServer4 使用OpenID Connect添加用户身份验证
使用IdentityServer4 实现OpenID Connect服务端,添加用户身份验证.客户端调用,实现授权. IdentityServer4 目前已更新至1.0 版,在之前的文章中有所介绍.I ...
- [CentOs7]搭建ftp服务器(2)——添加用户
摘要 上篇文章完成了ftp服务器的安装与匿名访问的内容,当然出于安全的考虑是不允许匿名访问服务器的,所以就有了本篇的内容 ,为ftp服务器添加用户,用改用户进行访问. vsftpd添加用户 FTP用户 ...
- sh3.useradd 添加用户脚本
1.写一个脚本: 添加10个用户user1到user10,密码同用户名,但要求只有用户不存在的情况下才能添加 #/bin/bash # ..};do if id user$i &> /d ...
- MySQL添加用户、删除用户与授权
MySql中添加用户,新建数据库,用户授权,删除用户,修改密码(注意每行后边都跟个;表示一个命令语句结束): 1.新建用户 1.1 登录MYSQL: @>mysql -u root -p @&g ...
- ftp 服务器搭建和添加用户和目录
安装: yum install -y vsftpd 修改配置: vsftpd.conf 修改:anonymous_enable=YES 改为:anonymous_enable=NO 启动/停止/重启 ...
- SharePoint 2013 表单认证使用ASP.Net配置工具添加用户
前 言 上面一篇博客,我们了解到如何为SharePoint 2013配置表单身份认证,但是添加用户是一个麻烦事儿:其实,我们还可以用Asp.Net的配置工具,为SharePoint 2013添加表单用 ...
- MySql安装与MySQL添加用户、删除用户与授权
1.安装MySql 目前MySQL有两种形式的文件,一个是msi格式,一个是zip格式的.msi格式的直接点击setup.exe就好,按照步骤进行.但是很多人下了zip格式的解压发现没有s ...
- linux 添加用户、权限
# useradd –d /usr/sam -m sam 此命令创建了一个用户sam,其中-d和-m选项用来为登录名sam产生一个主目录/usr/sam(/usr为默认的用户主目录所在的父目录). 假 ...
- 2------------NLPIR(ICTCLAS2016)分词系统添加用户词典功能
备注:win7 64位系统,netbeans编程 基本代码框架参见我的另一篇文章:NLPIR分词功能 代码实现: package cwordseg; import java.io.Unsupporte ...
随机推荐
- HTTP层 —— Session
1.简介 由于HTTP驱动的应用是无状态的,所以我们使用Session来存储用户请求信息.Laravel通过干净.统一的API处理后端各种Session驱动,目前支持的流行后端驱动包括Memcache ...
- unity3d遍历出Cube里面所有子对象
cube目录下有n个cube,可不可以一下子遍历出所有的对象,而不用一个一个的find?find(“Cube1”) 1.foreach(Transform ts in cube) 2.cub ...
- jquery获取文档高度和窗口高度的例子
jquery获取文档高度和窗口高度,$(document).height().$(window).height() $(document).height():整个网页的文档高度 $(window).h ...
- iOS开发——锁屏监听
公司所做的项目,锁屏监听是为了60秒后,解锁瓶后显示[手势解锁]或[指纹验证]: 第一步:AppDelegate.m 头部导入 #import <notify.h> #define Not ...
- UVALive 3027(并查集)
题意:某公司的各企业群要建立联系,I i j 表示企业i与企业j建立联系,并且以企业j为中心(并查集中的父亲)(企业j为暂时的中心企业),E i 表示查询企业 i 距离此时的中心企业的距离.各企业间的 ...
- bzoj3405:[Usaco2009 Open]Grazing2 移动牛棚
思路:首先因为要让距离尽量大,所以奶牛1一定在1号牛棚,奶牛n一定在s号牛棚,然后考虑dp. 因为总距离为s-1,然后要使长度为d的段数尽量多,那么剩下的一定就是d+1的段数,也就是s-(n-1)*d ...
- VisualLeakDetector
只需要#include "vld.h"就OK -------------------------------------- 找内存泄露挺方便的,比VS自带的详细.
- 《QQ欢乐斗地主》山寨版
使用Cocos2d-x编写,模仿<QQ欢乐斗地主>的界面实现了一个具有简单AI的单机版斗地主游戏. 游戏的详细说明请查看游戏目录下的help.txt文件. 下载地址: http://dow ...
- java 读写锁
http://tutorials.jenkov.com/java-concurrency/read-write-locks.html 翻译 读写锁比LOCK的实现更复杂,想象有一个应用程序能读和写一些 ...
- aix用命令查监听端口对应的进程
--aix$netstat -an|grep LISTEN|grep 7867tcp4 0 0 *.7867 *.* LISTEN$netstat -Aan|grep 7867f1000e00029f ...