How to connect to Debian 10 using Remote Desktop

Xrdp is a free and open-source implementation of Microsoft RDP (Remote Desktop Protocol) server that enables operating systems other than Microsoft Windows (such as Linux and BSD-style operating systems) to provide a fully functional RDP-compatible remote desktop experience.

Xrdp requires a GUI based System running on the system, if you already have one installed, you can skip to installing Xrdp step.

Installing Xfce Desktop Environment

Xfce is a lightweight desktop environment for UNIX-like operating systems. It aims to be fast and low on system resources, while still being visually appealing and user friendly.

First, check for any pending system updates,

apt update

apt upgrade

Installing Xfce.

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

Run the below command to install Xrdp

apt install xrdp 

Output:

[email protected]:~# apt install xrdp
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  ssl-cert xorgxrdp
Suggested packages:
  openssl-blacklist guacamole xrdp-pulseaudio-installer
The following NEW packages will be installed:
  ssl-cert xorgxrdp xrdp

To enable Xrdp on start up, use the command below.

systemctl enable xrdp

To check Xrdp status using the command below.

systemctl status xrdp

Output:

[email protected]:~# systemctl status xrdp
● xrdp.service - xrdp daemon
   Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: ena
   Active: active (running) since Thu 2021-01-07 12:50:07 EST; 10s ago
     Docs: man:xrdp(8)
           man:xrdp.ini(5)
 Main PID: 23484 (xrdp)
    Tasks: 1 (limit: 4701)
   Memory: 1.2M
   CGroup: /system.slice/xrdp.service
           └─23484 /usr/sbin/xrdp

Add the xrdp user to the group by running the following command.

adduser xrdp ssl-cert 

Output:

[email protected]:~# adduser xrdp ssl-cert
Adding user `xrdp' to group `ssl-cert' ...
Adding user xrdp to group ssl-cert
Done.

Configuring Firewall

Allow access to the Xrdp server from a specific IP address /IP range by running the following command.

ufw allow from IPADDRESS to any port 3389

Replace the IPADDRESS with actual IPv4 Address that you intend to connect with.

Output:

[email protected]:~# ufw allow from IPADDRESS to any port 3389
Rules updated   

If you want to allow access from anywhere by running the following command.

ufw allow 3389

Connect via Windows

Open Windows Remote Desktop Connection (RDP) Software and login to the desktop hostname or IP address.

images

Enter the username and password to connect using Xorg.

image

GUI welcome page will appear and you can access the Debian server.

image