In this article, we’ll take a look at how to enable Remote Desktop access to Ubuntu Server using xRDP.
Typically, Linux servers don’t have a graphical desktop interface. Therefore, you first need to install X11 and a lightweight desktop environment that will act as the engine for xRDP.
There are several desktop environments in the Ubuntu repository. In our case, we will be using Xfce. It is a fast, stable, and lightweight desktop environment for Linux.
Update packages to the latest version:
sudo apt update && apt -y dist-upgrade
sudo apt -y install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils
sudo apt -y install xrdp
Check that the xRDP daemon is installed and running:
sudo systemctl status xrdp
Add your user to the SSL-CERT group:
sudo adduser xrdp ssl-cert
The xRDP settings are specified in the xrdp.ini configuration file:
sudo nano /etc/xrdp/xrdp.ini
Add the following line to the end of the file:
And restart XRDP:
sudo systemctl restart xrdp
Remember to open port 3389 in the Linux firewall. The following command allows RDP connections to the server from the specified network:
sudo ufw allow from 192.168.1.0/24 to any port 3389