Loading... #0x00 本篇采用xfce4轻量级图形桌面 #0x01 安装桌面环境与VNC服务器: ```shell sudo apt install xfce4 xfce4-goodies vnc4server sudo apt install xdm ``` 如果想新建一个用户: ```shell sudo useradd -m userName -d /home/userName passwd userName 在/etc/sudoers里面将userName添加进去 ``` 执行完后重启: ```shell sudo shutdown now ``` 重启后执行: ```shell vnc4server 输入vnc密码 mv ~/.vnc/xstartup ~/.vnc/xstartup.bak nano ~/.vnc/xstartup ``` xstartup内容: ```shell #!/bin/sh xrdb $HOME/.Xresources unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources vncconfig -iconic & xfce4-session & startxfce4 & ``` 添加vnc服务器文件: ```shell sudo nano /etc/init.d/vncserver ``` 文件内容: ```shell #!/bin/bash PATH="$PATH:/usr/bin/" export USER="user" DISPLAY="1" DEPTH="16" GEOMETRY="1024x768" OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost" . /lib/lsb/init-functions ``` 授权: ```shell chmod +x ~/.vnc/xstartup sudo chmod +x /etc/init.d/vncserver ``` 开启服务: ```shell sudo service vncserver start ``` #0x02 打开vnc客户端 地址信息: ```shell 服务器ip:5901 或简写 服务器ip:1 ``` 输入密码 连接完成 ##END Last modification:October 24, 2019 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 如果觉得我的文章对你有用,请随意赞赏