How to Install Xrdp (Remote Desktop Protocol server) on Debian 10

Xrdp is an open source implementation of Microsoft’s Remote Desktop Protocol (RDP) that allows you to control your system remotely and quickly. With RDP, you can log into a remote computer and create a real desktop session just as if you were logged into the local computer. This article describes how to install and configure an Xrdp server on Debian 10 Linux.

Installing the desktop

Typically Linux servers do not have a desktop environment installed by default. The first step is to install X11 and a desktop environment that will act as the backend for Xrdp. Several desktop environments (DE) are available in the Debian repositories. We will be installing Xfce. It is a fast, stable, and lightweight desktop environment that makes it ideal for use on a remote server. If you prefer a different desktop environment like Gnome, you can install it instead of Xfce. Enter the following commands:

sudo apt update
sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils

Installing Xrdp

The Xrdp package is available in the standard Debian repositories. To install it, run:

sudo apt install xrdp

The service will automatically start after the installation process is complete. To verify that the Xrdp service is running, enter:

sudo systemctl status xrdp

The output will look something like this:

xrdp.service - xrdp daemon
   Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-04-01 21:19:11 UTC; 4s ago
  ...

By default, Xrdp uses the /etc/ssl/private/ssl-cert-snakeoil.key file, which is readable only by users who are members of the ssl-cert group. Run the following command to add the xrdp user to the group:

sudo adduser xrdp ssl-cert

Basic Xrdp setup

Next, you need to basic Xrdp setup. To do this, we recommend that you change the RDP port. For example, change the default from 3389 to 33389. To select a different port, you need to configure the sed command below:

sudo sed -i 's/3389/33389/g' /etc/xrdp/xrdp.ini

Next, you should open a port in the Ubuntu firewall, ufw

sudo ufw allow 33389

After that, restart your xrdp service:

sudo systemctl restart xrdp

Then, connect to your RDP client.

Was this article helpful?

Related Articles

Leave A Comment?