1.安裝Xfce:
sudo apt install xubuntu-desktop -y
2.安裝xrdp:
sudo apt install xrdp -y
3.配置xrdp,nano /etc/xrdp/xrdp.ini:
[Globals]
...
port=3389 ; 遠程連接端口,默認是3389,可以改成自己喜歡的端口...
;
; Session types
;; Some session types such as Xorg, X11rdp and Xvnc start a display server.
; Startup command-line parameters for the display server are configured
; in sesman.ini. See and configure also sesman.ini.
[Xorg]
name=Xorg
lib=libxup.so
username=ask ; 登錄用戶名
password=ask ; 登錄密碼
ip=127.0.0.1
port=-1
code=20...
4.添加xrdp登錄用戶,要跟xrdp.ini里面設置的一樣:
adduser ask
5.修改startwm.sh,nano /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# test -x /etc/X11/Xsession && exec /etc/X11/Xsession # 注釋掉
# exec /bin/sh /etc/X11/Xsession # 注釋掉
startxfce4 # 添加這個
6.重啟xrdp:
systemctl restart xrdp
7.用windows的遠程桌面測試能不能連接,不行重啟一下服務器再試試看,有其它問題歡迎留言探討。