197 字
1 分钟
692 次阅读

Ubuntu20.04 XRDP配置

2025-10-05
2026-01-10

安装XRDP#

sudo apt update
sudo apt install xrdp xserver-xorg-core xserver-xorg-input-all xorgxrdp
sudo adduser xrdp ssl-cert
sudo systemctl restart xrdp

配置XRDP#

编辑 /etc/xrdp/startwm.sh,在test -x /etc/X11/Xsession && exec /etc/X11/Xsession 前添加以下内容

unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR

指定桌面环境

echo gnome-session > ~/.xsession
cat <<EOF > ~/.xsessionrc
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
EOF

输入以下内容以解决登录需要频繁输入密码

sudo tee /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla > /dev/null <<'EOF'
[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactive=no
ResultActive=yes
EOF
sudo tee /etc/polkit-1/localauthority/50-local.d/46-allow-update-repo.pkla > /dev/null <<'EOF'
[Allow Package Management all Users]
Identity=unix-user:*
Action=org.freedesktop.packagekit.system-sources-refresh
ResultAny=yes
ResultInactive=yes
ResultActive=yes
EOF
sudo systemctl restart xrdp

登录XRDP#

Windows搜索RDP即可

登录XRDP - Ubuntu20.04 XRDP配置 操作截图 1

输入主机的IP、用户名、勾选 允许我保存凭据,然后输入密码后即可进入

登录XRDP - Ubuntu20.04 XRDP配置 操作截图 2

登录XRDP - Ubuntu20.04 XRDP配置 操作截图 3

Ubuntu20.04 XRDP配置
https://nvcc-v.com/2025/10/05/ubuntu-2004-xrdp-setup/
作者
Shattered217
发布于
2025-10-05
许可协议
CC BY-NC-SA 4.0

KEEP EXPLORING

相关文章

评论