ubuntu 22 安装轻量级桌面Xfce并使用xrdp远程桌面连接

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的远程桌面测试能不能连接,不行重启一下服务器再试试看,有其它问题欢迎留言探讨。

相关推荐
甲鱼9294 小时前
MySQL 实战手记:日志管理与主从复制搭建全指南
运维
Johny_Zhao18 小时前
OpenClaw安装部署教程
linux·人工智能·ai·云计算·系统运维·openclaw
chlk1232 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑2 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件2 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
碳基沙盒2 天前
OpenClaw 多 Agent 配置实战指南
运维
深紫色的三北六号3 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash3 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI3 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
十日十行4 天前
Linux和window共享文件夹
linux