Linux 安装xrdp

82 阅读1分钟

使用的Linux发行版

┌──(root㉿kali)-[~]
└─# lsb_release -a
No LSB modules are available.
Distributor ID: Kali
Description:    Kali GNU/Linux Rolling
Release:        2025.3
Codename:       kali-rolling

桌面环境使用的是Xfce

安装包

apt install xrdp

启动服务

systemctl enable --now xrdp

查看端口

查看3389端口是否监听了

┌──(root㉿kali)-[~]
└─# ss -tunlp                  
Netid  State   Recv-Q  Send-Q                     Local Address:Port     Peer Address:Port  Process                                    
udp    UNCONN  0       0                                0.0.0.0:4500          0.0.0.0:*      users:(("charon",pid=13866,fd=13))        
udp    UNCONN  0       0                                0.0.0.0:500           0.0.0.0:*      users:(("charon",pid=13866,fd=12))        
udp    UNCONN  0       0                                   [::]:4500             [::]:*      users:(("charon",pid=13866,fd=15))        
udp    UNCONN  0       0                                   [::]:500              [::]:*      users:(("charon",pid=13866,fd=14))        
udp    UNCONN  0       0        [fe80::20c:29ff:fea6:553f]%eth0:546              [::]:*      users:(("NetworkManager",pid=929,fd=28))  
tcp    LISTEN  0       128                              0.0.0.0:22            0.0.0.0:*      users:(("sshd",pid=4102,fd=6))            
tcp    LISTEN  0       2                                      *:3389                *:*      users:(("xrdp",pid=19121,fd=11))          
tcp    LISTEN  0       128                                 [::]:22               [::]:*      users:(("sshd",pid=4102,fd=7))            
tcp    LISTEN  0       2                                  [::1]:3350             [::]:*      users:(("xrdp-sesman",pid=19088,fd=11)) 

操作完上述步骤就可以使用RDP客户端进行测试了

2025-09-05_21-14.png

遇到的问题

问题一:黑屏

在使用RDP进行连接的时候可能会出现黑屏的问题,需要将原来的桌面注销后再使用RDP进行远程连接

问题二: Xfce桌面使用Xrdp连接时候闪退

同问题一的处理方法:需要将原来的桌面注销后再使用RDP进行远程连接