Connect Linux server with xRDP

How to connect Linux server with xRDP

Today’s topic is how to connect a Linux server with xRDP. Before explaining how to install and connect to a Linux server using xRDP, let’s play with terminology so that you have a clear understanding of what XRDP is and how it works; Microsoft has developed a proprietary protocol called Remote Desktop Protocol (RDP) that aims to provide a graphical interface for connecting a Windows user to a remote computer. Client software that provides this feature is also called RDP. In this regard, XRDP is an implementation of RDP on another operating system, in our case Linux Server, which equips the user with the same features. In this article, we want to access a remote Linux server with XRDP.

How does XRDP work?

To make it more clear for you, let’s say we have a remote Linux system that we want to access. Also, we have another system, not necessarily a Windows system, that you want to log into a remote Linux system and establish a desktop session as if you were logged in locally.

In practice, we need to install the RDP client software on the local machine and the XRDP server software on the remote Linux machine to create the connection. You must also have the login credentials and IP address of the remote Linux server.

Please note that multiple clients can access the remote machine with proper setup. Additionally, XRDP is free and open source. However, while the mentioned criteria are quite interesting in general usage, it can expose your Linux server to unauthorized access.

If you feel that you are at high risk, it is recommended to use alternative security-oriented tools such as SSH to reduce your risk. Additionally, it is recommended to use other tools if the command line interface (CLI) is sufficient for your needs and you do not need to work in a graphical user interface (GUI) environment.

Connect to the Linux server with xRDP.

In this tutorial, we will show you how to install and connect to a Linux server, in our case Ubuntu, with XRDP.

Install the Gnome or Xfce desktop environment

As a preliminary step, we are going to install a Desktop Environment (DE) on Ubuntu since we want to communicate with our Linux server rather than just using commands.

Note: If you are on a desktop version of Ubuntu, skip this step. To successfully install a DE, we first need to add a sudo user to Ubuntu and run the corresponding commands from there using administrative privileges.

Two good desktop environments are introduced here. You can choose one based on your discretion.

GNOME is a default DE in Ubuntu 20.04 and we only need to pass a few commands to install it.

sudo apt updatesudo apt install ubuntu-desktop

After running the last line, you will be asked if you want to continue or cancel the installation because 2111 MB of additional disk space will be used.

You can type Y and press enter, and wait a while until the GUI packages are completely downloaded and installed.

As a second option, there is another DE called Xfce which is reliably fast and graphically attractive. You can run the following commands and the rest of the process is similar to installing GNOME.

sudo apt updatesudo apt install xubuntu-desktop

Install XRDP: Linux

Ubuntu already has the XRDP package. Type the following command to install it.

sudo apt install xrdp

XRDP will start working immediately after installation completion but you can check the status of XRDP by running the below commands.

 sudo systemctl status xrdp

Hold on a moment! XRDP is still unable to work properly! Linux groups are defined for security reasons and, as a result, deny certain users access to certain files. If some users require additional privileges, we can manually grant them the necessary access.

In our case, XRDP needs to read “/etc/SSL/private/ssl-cert-snakeoil.key” but it is not a member of the corresponding group. Only members of the “ssl-cert” group are allowed to use this file. We are supposed to allow XRDP users and we will do that by executing the following command.

sudo adduser xrdp ssl-cert

Let’s restart XRDP to apply the new settings.

sudo systemctl restart xrdp

Done! XRDP installation is finished.

Remote Desktop Protocol (RDP): Local Windows or Linux

Connect Linux server with xRDP

Now we need to put the last Lego brick in our fancy bridge to connect to a remote Linux machine. If your local machine is on Windows, you can use the default Remote Desktop Connection to create the connection. Just open RDC, which acts as Remote Desktop Protocol, pass the IP address of the remote server, and click connect.

Afterward, you will be asked for credentials and done! You are in control of a remote Linux server. If your local machine is on Linux (Ubuntu), you can choose GNOME Box to set up RDP. Please type the following command:

sudo apt install gnome-boxes

Once the installation is complete, start Gnome Boxes and do as shown in the image below.

After that, pass the IP address of the remote machine and click on ‘Connect’

Connect Linux server with xRDP

In the image below, ‘Session’ should be ‘Xorg’. Also, you can pass the credentials of the remote machine and click OK to proceed.

At this point, you should be able to do what you can when using the remote server locally.

Conclusion

In this paper, we first define some concepts about XRDP. We then created a set-up to clarify what would be instructed throughout the tutorial. We later concluded that if you are very concerned about the security aspect of your remote connection, it is best practice to use other tools. Next, we have detailed how to install and connect to a Linux server with XRDP. Buy RDP From Oudel Inc. Learn How RDP Works here.

Scroll to Top