安装xrdp、xfce4
apt-get install -y xrdp xfce4
修改 xrdp 配置文件启用 xfce 桌面
vim /etc/xrdp/startwm.sh
修改后文件如下:
#!/bin/sh
# xrdp X session start script (c) 2015, 2017, 2021 mirabilos
# published under The MirOS Licence
# Rely on /etc/pam.d/xrdp-sesman using pam_env to load both
# /etc/environment and /etc/default/locale to initialise the
# locale and the user environment properly.
if test -r /etc/profile; then
. /etc/profile
fi
unset DBUS_SESSION_DUS_ADDRESS
unset XDG_RUNTIME_DIR
.$HOME/.profile
echo "xfce4-session"
test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/Xsession
启动服务并开机自启
systemctl start xrdp
systemctl enable xrdp