XRDP is an open-source version of RDP (Remote Desktop Protocol). If you would like to access your shell using a Remote Desktop Connection on Windows, this can be done by using an XRDP server. In this article, we will guide you through installation and establishing a connection to your Ubuntu Shell.
Prerequisite
In order for XRDP to work as intended, you will need to purchase a pubic IP. Please click on the link below for instructions on how to do so.
How to Purchase and Activate a Dedicated Public IP Address for your Shell™
Installation
First, we will need to open a terminal session by selecting on bottom right of the Ubuntu desktop and type in the search bar up top to open.
Next, we will update our system packages
sudo apt update
After our update, we will install XRDP server.
sudo apt install xrdp
Then, let's start and enable XRDP. We use "enable" to make sure the XRDP will start at boot.
sudo systemctl start xrdp
sudo systemctl enable xrdp
After that, let's check the status of XRDP. If all is working, you should see a status like in the screenshot below.
sudo systemctl status xrdp
Now, we need to add xrdp to ssl-cert user group. XRDP uses an ssl certificate and we need to make it readable to our user.
sudo adduser xrdp ssl-cert
Installing and configuring XFCE
We need to install XFCE4 because X11 for XRDP does not work with gnome that well. Use the command below to install.
sudo apt install xubuntu-desktop
Once that installation is finished, we will edit our xsession file. We will use the echo command to do this. This will force all XRDP sessions to use XFCE4.
echo xfce4-session >~/.xsession
Now, we need to restart XRDP
sudo systemctl restart xrdp
Configuring UFW Firewall
We will need to allow access to our XRDP from the remote end. We will be using the UFW firewall on Ubuntu to do so. So first let's make sure that we have UFW installed and enable. <update 1>
sudo apt install ufw
sudo ufw enable
After that, for security reasons, we will only allow the IP address from YOUR LOCAL COMPUTER to access our XRDP server and deny all other hosts. <update 2>
sudo ufw allow from 'your local computers IP address' to any port 3389
replace “your local computers IP address” with your computer's public IP. If you are unfamiliar with getting that info you can google search: "what is my IPv4 address" and you should be able to locate your public IP with the search results.
Connecting to your XRDP server using Windows RDP
<update 3> Before connecting, we must add a new user to our Shells OS. Important to make a password for both your main user and user2. You can do so in your settings or via your terminal.
sudo adduser namehere
<image is for xubuntu but the same concept applies for Ubuntu, add a password to the main user, and add a second user with its own password>
You can give both users admin access through these settings too. You can now access your Shell via remotely. Make sure to close your Shell before accessing or access the other user.
On Windows 10, on the bottom left in the search field type remote and click on Remote Desktop Connection once you see it populate. Once opened you should see a window like the one shown below.
Enter the public IP that you have purchased from ShellsTM and click Connect. After that, log in with your Ubuntu username and password
Now you should be logged in to your XRDP session. You can also use Remmina to access an XRDP session from a Linux desktop.