CentOS 7: How to use xrdp remote access


Step 1: Install XRDP

[root@tutorialspots ~]# yum install xrdp -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.host-engine.com
 * epel: mirror.steadfastnet.com
 * extras: mirrors.usinternet.com
 * nux-dextop: mirror.li.nux.ro
 * remi-safe: mirror.pit.teraswitch.com
 * updates: repos-tx.psychz.net
Resolving Dependencies
--> Running transaction check
---> Package xrdp.x86_64 1:0.9.13.1-1.el7 will be installed
--> Processing Dependency: libfuse.so.2(FUSE_2.4)(64bit) for package: 1:xrdp-0.9.13.1-1.el7.x86_64
--> Processing Dependency: libfuse.so.2(FUSE_2.5)(64bit) for package: 1:xrdp-0.9.13.1-1.el7.x86_64
--> Processing Dependency: libfuse.so.2(FUSE_2.6)(64bit) for package: 1:xrdp-0.9.13.1-1.el7.x86_64
--> Processing Dependency: libfuse.so.2()(64bit) for package: 1:xrdp-0.9.13.1-1.el7.x86_64
--> Running transaction check
---> Package fuse-libs.x86_64 0:2.9.2-11.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch           Version                    Repository    Size
================================================================================
Installing:
 xrdp              x86_64         1:0.9.13.1-1.el7           epel         429 k
Installing for dependencies:
 fuse-libs         x86_64         2.9.2-11.el7               base          93 k

Transaction Summary
================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 522 k
Installed size: 2.4 M
Downloading packages:
(1/2): fuse-libs-2.9.2-11.el7.x86_64.rpm                   |  93 kB   00:00
(2/2): xrdp-0.9.13.1-1.el7.x86_64.rpm                      | 429 kB   00:00
--------------------------------------------------------------------------------
Total                                              825 kB/s | 522 kB  00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : fuse-libs-2.9.2-11.el7.x86_64                                1/2
  Installing : 1:xrdp-0.9.13.1-1.el7.x86_64                                 2/2
  Verifying  : fuse-libs-2.9.2-11.el7.x86_64                                1/2
  Verifying  : 1:xrdp-0.9.13.1-1.el7.x86_64                                 2/2

Installed:
  xrdp.x86_64 1:0.9.13.1-1.el7

Dependency Installed:
  fuse-libs.x86_64 0:2.9.2-11.el7

Complete!

Step 2: Install xfce
CentOS 7: 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

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:

[root@tutorialspots ~]# systemctl enable xrdp
Created symlink from /etc/systemd/system/multi-user.target.wants/xrdp.service to /usr/lib/systemd/system/xrdp.service.
[root@tutorialspots ~]# systemctl start xrdp

Check status:

[root@tutorialspots ~]# systemctl status xrdp
● xrdp.service - xrdp daemon
   Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2020-08-09 03:54:47 CDT; 5s ago
     Docs: man:xrdp(8)
           man:xrdp.ini(5)
 Main PID: 9999 (xrdp)
    Tasks: 1
   CGroup: /system.slice/xrdp.service
           └─9999 /usr/sbin/xrdp --nodaemon

Aug 09 03:54:47 tutorialspots.net systemd[1]: Started xrdp daemon.
Aug 09 03:54:47 tutorialspots.net xrdp[9999]: (9999)(140492565961152)[INFO ]...9
Aug 09 03:54:47 tutorialspots.net xrdp[9999]: (9999)(140492565961152)[INFO ]...1
Aug 09 03:54:47 tutorialspots.net xrdp[9999]: (9999)(140492565961152)[INFO ]...0
Aug 09 03:54:47 tutorialspots.net xrdp[9999]: (9999)(140492565961152)[INFO ]...e
Hint: Some lines were ellipsized, use -l to show in full.

Step 6: connect RDP by mstsc

mstsc xvnc

Leave a Reply