zoukankan      html  css  js  c++  java
  • linux 安装SNV服务

    1.安装vnc server
    [root@pxe ~]# yum install tigervnc-server -y

    2.设置 vnc server 开机启动
    [root@pxe ~]# chkconfig vncserver on

    3.修改vncserver 配置文件
    [root@pxe ~]# vi /etc/sysconfig/vncservers
    在配置文件后添加以下内容
    VNCSERVERS="2:root"
    VNCSERVERARGS[2]="-geometry 1366x768 -nolisten tcp"

    设置vncserver 的密码
    [root@pxe ~]# vncpasswd
    Password:
    Verify:

    4.启动sncserver 服务
    [root@pxe ~]# /etc/init.d/vncserver start

    ////////下面内容待验证////////////////////////////

    CentOS7配置VNC
    centos7配置vnc远程.pdf

    一.安装
    以root用户运行以下命令来安装vncserver;
    yum install tigervnc-server
    同样运行以下命令来安装vncviewer;
    yum install vnc
    停止并禁用防火墙;
    systemctl stop firewalld.service
    systemctl disable firewalld.service

    二.配置
    vncviewer基本上不用配置;
    vncserver的配置,创建一个新的配置文件,以开启1号窗口为例(也可以同时开启多个窗口,修改数字即可),方法如下:
    cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service
    或者再增加一个窗口:

    cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:2.service

    编辑/lib/systemd/system/vncserver@:1.service,设置用户root相关参数
    [Service]
    Type=forking
    # Clean any existing files in /tmp/.X11-unix environment
    ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
    ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i -geometry 800x600"
    PIDFile=/root/.vnc/%H%i.pid
    ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

    三.应用
    更新systemctl以使其生效;
    systemctl daemon-reload
    设置vncserver的密码;
    vncpasswd root
    按提示输入密码以及确认密码
    启动该服务用来启用vnc的1号窗口;
    systemctl start vncserver@:1.service 或者 vncserver :1
    关闭1号窗口:
    systemctl stop vncserver@:1.service 或者 vncserver -kill :1
    设置为开机自动启动;
    systemctl enable vncserver@:1.service
    End.

    [转自]http://www.cnblogs.com/xieshengsen/p/5848902.html

  • 相关阅读:
    JAVA总结--正则表达式
    JAVA总结--java数据类型
    数据结构与算法
    JAVA总结--JDK版本区别
    JAVA总结--代码规范
    .net core 学习笔记(4)-ViewComponent
    .net core学习笔记(3)-依赖注入
    .net core 学习笔记(2)-中间件
    .net core 学习笔记(1)-分页控件的使用
    taginput ,complete使用笔记
  • 原文地址:https://www.cnblogs.com/workherd/p/6796632.html
Copyright © 2011-2022 走看看