zoukankan      html  css  js  c++  java
  • 如何在CentOS中设置VNC多用户登录

     
    1、安装VNC软件
    yum install tigervnc tigervnc-server fontforge -y
    2、配置多个用户用户下的vnc登录密码
    #例如设置oracle用户的vnc登录密码:
    
    [oracle@oracle ~]$ id
    uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
    [oracle@oracle ~]$ vncpasswd 
    Password:
    Verify:
    3.编辑vnc配置文件
    [root@oracle ~]# more  /etc/sysconfig/vncservers 
    # The VNCSERVERS variable is a list of display:user pairs.
    #
    …………(省略部分内容)
    # `man vncviewer' manual page.
    
    # VNCSERVERS="2:myusername"
    # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
    
    VNCSERVERS="1:root 2:oracle"
    VNCSERVERSVNCSERVERARGS[1]="-geometry 1024x768 -alwaysshared"  
    VNCSERVERSVNCSERVERARGS[2]="-geometry 1024x768 -alwaysshared"

    注意:-geometry 1024x768表示分辨率;-alwaysshared 表示允许多终端同时登陆


    4、打开对应的端口

    打开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服务

  • 相关阅读:
    bzoj 2527: [Poi2011]Meteors 整体二分
    bzoj 2738 矩阵乘法
    bzoj 3110 K大数查询
    bzoj 3262 陌上花开
    cogs 577 蝗灾 CDQ分治
    bzoj 1101 zap
    bzoj 2005
    bzoj 3518 Dirichlet卷积
    bzoj 1257
    最优贸易 [NOIP 2009]
  • 原文地址:https://www.cnblogs.com/zhuntidaoren/p/7755102.html
Copyright © 2011-2022 走看看