修改/root/.vnc/xstartup文件: [ root @ localhost.VNC ] # cat x startup #! /包容的仙人掌/shunsetsession _ managerunsetdbus _ session _ bus _ address # exec/etc/X11/xinit/xinitrc///注释此行接通vncserver@:1.service服务的电源并设置启动systemctlenablevncserver @ :1.service一般用户(abc )的操作步骤
abc用户的示例是abc组复制配置文件CP/lib/systemd/system/VNC server @.service/etc/systemd/system/更改注意配置文件权限以避免与VNCserver@33602.service root使用的:1冲突chown ABC : ABC/etc/systemd/system/VNC server @ :2
在/etc/systemd/system/VNC server @ :2.service中更改以下内容: [ unit ] description=远程桌面服务(VNC ) after=systion Type=simple //此处为simple # cleananyexistingfilesin/tmmm 包容的仙人掌/sh -c '/usr/包容的空值21|||: ' execstart=/usr/s包容的仙人掌/runuser -l abc -c '/usr/包容的仙人掌/VNC servs 变更为的abcExecStop=/包容的仙人掌/sh -c '/usr/包容的仙人掌/VNC server-kill % I/dev/null 21|| : ' [安装] wanted ball
在test用户下使用vncserver :2命令启动桌面。 在这里让我输入两次vnc的密码。
通过vncserver -list命令可以查看当前启动的桌面的vnc桌面端口号。 (