zoukankan      html  css  js  c++  java
  • centos7 搭建vnc

    TigerVNC使用非加密的链接,默认会被firewalld blocked 掉,想要 vnc正常工作就需要让firewalld开放相应的端口才行。

    vnc默认的端口号为5900,而每个vnc window的端口号是: 5900+window_number(or,display_number)

    如:systemctl start vncserver-username@:2.service  那么这个vnc window的端口号就是 5902

    1. Installing VNC Server

    ~]# yum install tigervnc-server

    2. Configuring VNC Server

    #cp /usr/lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
    

      


    2.1 修改配置文件
    vncserver@:1.service,把USER修改为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=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i"
    PIDFile=/root/.vnc/%H%i.pid
    ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
    

      

      


    2.2 To make the changes take effect immediately, issue the following command:
    systemctl daemon-reload
    
    2.3 Set the password for the user or users defined in the configuration file.
    ~]$ vncpasswd
    Password:
    Verify:
    

      

    3. Starting VNC Server

    ~]# systemctl start vncserver@:1.service
    

      

     
    查看端口监听状态:

    [root@rusky system]# netstat -an | grep 5901
    tcp        0      0 0.0.0.0:5901            0.0.0.0:*               LISTEN    
    tcp6       0      0 :::5901                 :::*                    LISTEN

    要关闭服务器上的防火墙。

    4. 使用VNCViewer客户端连接到VNC服务

    IP:端口或是IP: displayNumber

     

    转:https://www.cnblogs.com/rusking/p/6023170.html

  • 相关阅读:
    Appium:四:控件
    Appium:三:APP元素定位
    jmeter分布式踩得坑汇总
    Linux环境下进行分布式压测踩过的坑
    记录一次余额迁移的坑(测试角度)
    记录性能测试脚本开发的过程
    jmeter如何设置全局变量
    性能测试,如何得到大量token,并保存在本地文件中
    小程序测试心得
    测试管理三
  • 原文地址:https://www.cnblogs.com/royfans/p/12548092.html
Copyright © 2011-2022 走看看