ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

vncserver 添加用户

2019-09-15 11:02:43  阅读:699  来源: 互联网

标签:vnc geometry 用户 vncserver 添加 huilin localhost VNC


原文链接:https://my.oschina.net/u/1590001/blog/268242 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 :2
# 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[1]="-geometry 1280X1024"
VNCSERVERARGS[2]="-geometry 1280X1024 -alwaysshared"
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-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加界面号的方式)

 

 

转载于:https://my.oschina.net/u/1590001/blog/268242

标签:vnc,geometry,用户,vncserver,添加,huilin,localhost,VNC
来源: https://blog.csdn.net/cheshifei3571/article/details/100849184

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有