网站开发需要多长时间,排名点击软件怎样,中国建设监督网站,旅游网站开发方案ppt写在前面我的服务器为Centos7#xff0c;其他 Linux 发行版可能略有差异。此方法不需要有物理显示屏。可以多用户同时登录#xff0c;同一用户可以开启多个虚拟桌面。TigerVNC 安装使用这个软件提供 VNC 服务。Centos 下安装sudo yum install -y tigervnc-server用户模式开启…写在前面我的服务器为Centos7其他 Linux 发行版可能略有差异。此方法不需要有物理显示屏。可以多用户同时登录同一用户可以开启多个虚拟桌面。TigerVNC 安装使用这个软件提供 VNC 服务。Centos 下安装sudo yum install -y tigervnc-server用户模式开启服务还可以通过系统服务开启但觉得没必要。根据谁需要谁开启的原则会好一点安全性也高一点。直接在自己的账户下运行 vncserver 。第一次会要求设定密码后期可以通过 vncpasswd 命令可以修改密码。第一次运行还会初始化在家家目录下生成 .vnc 文件夹里边有 config 、localhost.localdomain:1.log localhost.localdomain:1.pid 、passwd 、xstartup 等文件。$vncserverYou will require a password to access your desktops.Password:Verify:Would you like to enter a view-only password (y/n)? nA view-only password is not usedNew localhost.localdomain:1 (longfei) desktop is localhost.localdomain:1Creating default startup script /home/lo/.vnc/xstartupCreating default config /home/lo/.vnc/configStarting applications specified in /home/lo/.vnc/xstartupLog file is /home/lo/.vnc/localhost.localdomain:1.log查看运行状态。如果没有其他问题查看log文件显示如下。$cat localhost.localdomain\:1.logXvnc TigerVNC 1.8.0 - built Nov 2 2018 19:05:14Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt)See http://www.tigervnc.org for information on TigerVNC.Underlying X server release 12001000, The X.Org FoundationFri May 22 11:27:09 2020vncext: VNC extension running!vncext: Listening for VNC connections on all interface(s), port 5901vncext: Listening for HTTP connections on all interface(s), port 5801vncext: created VNC server for screen 0Fri May 22 11:27:13 2020ComparingUpdateTracker: 0 pixels in / 0 pixels outComparingUpdateTracker: (1:-nan ratio)设置防火墙白名单。从log文件里我们看到 VNC 连接使用的端口是5901所以要把这个5901端口放行。当然这个端口不是固定的默认从5901开始往后排第一个用户开启服务是5901第二个用户用户开始服务就是5902了。所以管理员可以开通5901-5910端口供用户使用方法不再赘述。关闭服务。localhost.localdomain:1.pid 里边有服务进程号直接使用 kill 命令结束进程就行。也可以使用 vncserver -kill :1 :1 就是刚才运行的第一个服务。远程连接。windows 端可以使用 VNC viewer 等软件。直接输入 ip:端口号然后提示输入密码就行了。image进阶config目录下这个文件是配置文件主要是设置一些默认参数。但是 securitytypesvncauth,tlsvnc 参数不要随便设置我copy了官方文档里的设置结果耗了一天时间没有成功连通所以不要修改默认就好。具体参数说明参考https://tigervnc.org/doc/vncserver.html 。例如 geometry2000x1200 设置屏幕大小等。当然也可以不在 config 文件里写入默认配置直接在运行 vncserver 时后面加上命令一样的效果。$cat config## Supported server options to pass to vncserver upon invocation can be listed## in this file. See the following manpages for more: vncserver(1) Xvnc(1).## Several common ones are shown below. Uncomment and modify to your liking.### securitytypesvncauth,tlsvnc# desktopsandbox# geometry2000x1200# localhost# alwayssharedxstartup这个文件主要设置开启的桌面。例如我的服务器上安装了 gnome 桌面从文档里看我就不需要修改。如果安装的是其他桌面程序需要看官方文档自行修改。$cat xstartup#!/bin/shunset SESSION_MANAGERunset DBUS_SESSION_BUS_ADDRESS/etc/X11/xinit/xinitrc# Assume either Gnome or KDE will be started by default when installed# We want to kill the session automatically in this case when user logs out. In case you modify# /etc/X11/xinit/Xclients or ~/.Xclients yourself to achieve a different result, then you should# be responsible to modify below code to avoid that your session will be automatically killedif [ -e /usr/bin/gnome-session -o -e /usr/bin/startkde ]; thenvncserver -kill $DISPLAYfi