macOS用xrdp远程Ubuntu桌面
1. Ubuntu 配置
# 1. 安装 xrdp 和xfce4轻量桌面
sudo apt update
sudo apt install xrdp xfce4 xfce4-goodies -y
# 2. 配置会话启动桌面
echo xfce4-session > ~/.xsession
echo "export DESKTOP_SESSION=xfce" > ~/.xsessionrc
# 3. 修正证书权限(防止连接失败)
sudo chown -v xrdp:xrdp /etc/xrdp/key.pem /etc/xrdp/cert.pem
sudo chmod -v 600 /etc/xrdp/key.pem /etc/xrdp/cert.pem
# 4. 开放防火墙端口
sudo ufw allow 3389/tcp
# 5. 禁用 Wayland(可选,但建议)
sudo vim /etc/gdm3/custom.conf
# 取消注释:
WaylandEnable=false
# 6. 重启
sudo reboot
2. macOS端连接
-
新建PC连接:
- PC name:Ubuntu 的 IP
- 用户名/密码:Ubuntu 登录账号
-
保存并连接