Assuming the environment is CentOS 7, see the related video link below

Setting up and using RDP for remote server control

Install xrdp and the Desktop System

The steps to install xrdp on CentOS 7 are as follows:

  1. Install the xrdp and tigervnc-server packages. You can use the following command to install them:
sudo yum install xrdp -y
sudo yum install tigervnc-server -y
  1. Start the xrdp service and configure it to start on boot. You can use the following commands to complete these tasks:
sudo systemctl start xrdp
sudo systemctl enable xrdp
netstat -an | grep 3389
  1. If SELinux is enabled in your system, you may need to configure SELinux; otherwise, the xrdp service may fail to start or encounter errors during startup. You can use the following commands to perform these operations:
sudo chcon -t bin_t /usr/sbin/xrdp
sudo chcon -t bin_t /usr/sbin/xrdp-sesman
  1. If a firewall is enabled on your system, you need to open port 3389 to enable remote desktop connections to your CentOS 7 system. You can use the following commands to perform these operations:
sudo firewall-cmd --permanent --zone=public --add-port=3389/tcp
sudo firewall-cmd --reload

Install the GNOME Desktop desktop environment

sudo yum groupinstall "GNOME Desktop" -y
sudo yum groupinstall "Xfce" -y

Set Username and Password

passwd

Remote Testing with Remmina

Switch to Xfce

To switch your xrdp connection to the Xfce desktop, you need to perform the following steps on CentOS 7:

  1. Install the Xfce desktop environment. You can use the following command to install Xfce:
sudo yum groupinstall "X Window System"
sudo yum --enablerepo=epel -y groups install "Xfce"
  1. Configure xrdp to use Xfce as the desktop environment. You can use the following commands to complete these operations:
echo "xfce4-session" > ~/.Xclients
chmod +x ~/.Xclients
  1. Restart the xrdp service for the changes to take effect. You can use the following command to do this:
sudo systemctl restart xrdp

Meeting Minutes

Subject: Setting Up and Using RDP Server Remote Control

Date: 2023-08-16 10:50:38

Recording file: https://meeting.tencent.com/v2/cloud-record/share?id=c504fcca-c89c-4923-9ccb-3140068773a4&from=3

Access password: SeWf

Setting up ubuntu xrdp

Installing xrdp directly on Ubuntu is highly likely to cause a series of issues, so this guide uses the xrdp installation script

wget https://www.c-nergy.be/downloads/xRDP/xrdp-installer-1.4.2.zip
unzip xrdp-installer-1.4.2.zip
chmod +x ./xrdp-installer-1.4.2.sh
./xrdp-installer-1.4.2.sh
# 服务状态监测如上

Desktop Environment Switching

sudo nano /etc/xrdp/startwm.sh
# 在文件的末尾,找到以下两行代码
#test -x /etc/X11/Xsession && exec /etc/X11/Xsession
#exec /bin/sh /etc/X11/Xsession
# 将这两行代码注释掉,在它们下面添加以下内容
gnome-session # 目标桌面环境
# 保存并关闭文件
# 重启 xrdp 服务:
sudo service xrdp restart

todo: Recording

More References