CentOS 8: How to use xrdp remote access


Step 1: Install XRDP

[root@tutorialspots ~]# yum install xrdp -y
Last metadata expiration check: 2:22:44 ago on Fri 22 Jan 2021 01:55:08 PM CET.
Dependencies resolved.
================================================================================
 Package                     Arch       Version             Repository     Size
================================================================================
Installing:
 xrdp                        x86_64     1:0.9.15-3.el8      epel          447 k
Installing dependencies:
 tigervnc-license            noarch     1.10.1-9.el8_3      AppStream      38 k
 tigervnc-server-minimal     x86_64     1.10.1-9.el8_3      AppStream     1.1 M

Transaction Summary
================================================================================
Install  3 Packages

Total download size: 1.6 M
Installed size: 4.9 M
Downloading Packages:
(1/3): tigervnc-license-1.10.1-9.el8_3.noarch.r 486 kB/s |  38 kB     00:00
(2/3): tigervnc-server-minimal-1.10.1-9.el8_3.x 5.4 MB/s | 1.1 MB     00:00
(3/3): xrdp-0.9.15-3.el8.x86_64.rpm             2.0 MB/s | 447 kB     00:00
--------------------------------------------------------------------------------
Total                                           4.7 MB/s | 1.6 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : tigervnc-license-1.10.1-9.el8_3.noarch                 1/3
  Installing       : tigervnc-server-minimal-1.10.1-9.el8_3.x86_64          2/3
  Installing       : xrdp-1:0.9.15-3.el8.x86_64                             3/3
  Running scriptlet: xrdp-1:0.9.15-3.el8.x86_64                             3/3
  Verifying        : tigervnc-license-1.10.1-9.el8_3.noarch                 1/3
  Verifying        : tigervnc-server-minimal-1.10.1-9.el8_3.x86_64          2/3
  Verifying        : xrdp-1:0.9.15-3.el8.x86_64                             3/3

Installed:
  tigervnc-license-1.10.1-9.el8_3.noarch
  tigervnc-server-minimal-1.10.1-9.el8_3.x86_64
  xrdp-1:0.9.15-3.el8.x86_64

Complete!

Step 2: Install xfce
CentOS 8: how to install xfce Desktop

Step 3 – Configure xRDP

In this step, we create 2 new files: ~/startwm.sh and ~/.xsession

su - tutorialspots
vi ~/startwm.sh

Content:

#!/bin/sh
 
if [ -r /etc/default/locale ]; then
  . /etc/default/locale
  export LANG LANGUAGE
fi
 
startxfce4

chmod a+x ~/startwm.sh

echo xfce4-session > ~/.xsession

Step 4: edit file /etc/xrdp/xrdp.ini

sudo vi /etc/xrdp/xrdp.ini

Content:

...
; security layer can be 'tls', 'rdp' or 'negotiate'
; for client compatible layer
security_layer=rdp
 
; minimum security level allowed for client for classic RDP encryption
; use tls_ciphers to configure TLS encryption
; can be 'none', 'low', 'medium', 'high', 'fips'
crypt_level=none
...

config xrdp ini

Step 5:

sudo systemctl enable xrdp
sudo systemctl start xrdp

Check status:

[tutorialspots@CentOS-82-64-minimal ~]$ sudo systemctl status xrdp
● xrdp.service - xrdp daemon
   Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; vendor preset>
   Active: active (running) since Fri 2021-01-22 16:27:25 CET; 23s ago
     Docs: man:xrdp(8)
           man:xrdp.ini(5)
 Main PID: 704204 (xrdp)
    Tasks: 1 (limit: 100580)
   Memory: 920.0K
   CGroup: /system.slice/xrdp.service
           └─704204 /usr/sbin/xrdp --nodaemon

Jan 22 16:27:25 CentOS-82-64-minimal systemd[1]: Started xrdp daemon.
Jan 22 16:27:25 CentOS-82-64-minimal xrdp[704204]: [INFO ] starting xrdp with p>
Jan 22 16:27:25 CentOS-82-64-minimal xrdp[704204]: [INFO ] address [0.0.0.0] po>
Jan 22 16:27:25 CentOS-82-64-minimal xrdp[704204]: [INFO ] listening to port 33>
Jan 22 16:27:25 CentOS-82-64-minimal xrdp[704204]: [INFO ] xrdp_listen_pp done
l

Step 6: open port 3389

sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" port protocol="tcp" port="3389" accept'
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" port protocol="udp" port="3389" accept'
sudo firewall-cmd --reload

Step 7: connect RDP by mstsc

mstsc xvnc

Leave a Reply