How to Install Xrdp Server (Remote Desktop) on Ubuntu 20.04

How to Install Xrdp Server (Remote Desktop) on Ubuntu 20.04

Xrdp is an open source implementation of Microsoft's Remote Desktop Protocol (RDP) that allows you to control a remote system through a graphical interface. With RDP, you can log in to a remote machine and create a real desktop session just like you would if you were logged in to the local machine.

This tutorial explains how to install and configure Xrdp server on Ubuntu 20.04.

1. Install the desktop environment

Ubuntu servers are typically managed using the command line and do not come with a desktop environment installed by default. If you are running Ubuntu Desktop, ignore this step.

There are many desktop environments for you to choose from in the Ubuntu source repository. One option is to install Gnome, which is the default desktop environment for Ubuntu 20.04. Another option is to install xfce. It is a fast, stable, and lightweight desktop environment, making it an ideal desktop for remote servers.

Run any of the following commands to install the desktop environment of your choice:

Install Gnome

sudo apt update
sudo apt install ubuntu-desktop

Install Xfce

sudo apt update
sudo apt install xubuntu-desktop

Depending on your system, downloading and installing the GUI packages may take some time.

2. Install Xrdp

Xrdp is included in the default Ubuntu software repositories. To install it, run:

sudo apt install xrdp

Once the installation is complete, the Xrdp service will start automatically. You can verify it by typing:

sudo systemctl status xrdp

The output will look like this:

● xrdp.service – xrdp daemon
Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-05-22 17:36:16 UTC; 4min 41s ago
...

By default, Xrdp uses /etc/ssl/private/ssl-cert-snakeoil.key which is only readable by the "ssl-cert" user group. Run the following command to add the xrdp user to this user group:

sudo adduser xrdp ssl-cert

Restart the Xrdp service to make the changes take effect:

sudo systemctl restart xrdp

that's all. Xrdp has been installed on your Ubuntu server and you can start using it.

3. Xrdp Configuration

Xrdp configuration files are located in the /etc/xrdp directory. For basic Xrdp connections, you don't need to make any changes to the configuration files.

Xrdp uses the default X Window desktop environment (Gnome or XFCE).

The main configuration file is named xrdp.ini. This file is divided into different sections, allowing you to set global configuration, such as security, listening addresses, creating different xrdp login sessions, etc.

Whenever you make changes to the configuration file, you need to restart the Xrdp service.

Xrdp uses the startwm.sh file to start an X session. If you want to use another X Window desktop, edit this file.

4. Configure the firewall

The Xrdp daemon listens on port 3389 on all network interfaces. If you are running a firewall on your Ubuntu server, you need to open the Xrdp port.

To allow access to the Xrdp server from a specific IP address or IP range, for example 192.168.33.0/24 , you need to run the following command:

sudo ufw allow from 192.168.33.0/24 to any port 3389

If you want to allow access from anywhere (which is discouraged for security reasons), run:

sudo ufw allow 3389

For added security, you might consider having Xrdp listen only on localhost, and creating an SSH tunnel to encrypt the traffic from port 3389 on your local machine to the same port on the remote server.

5. Connecting to Xrdp Server

Now that you have set up your Xrdp server, it's time to open your Xrdp client and connect to the server.

If you have a Windows computer, you can use the default RDP client. Type "remote" in the Windows search bar and click "Remote Desktop Connection". This will open an RDP client. Enter the remote server IP address in the "Computer" area and click "Connect".

On the login screen, enter your username and password and click OK.

Once logged in, you will see the default Gnome or Xfce desktop, which should look like this:

You can now interact with the remote desktop using your keyboard and mouse from your local machine.

If you're running macOS, you can install the Microsoft Remote Desktop app from the Mac App Store. Linux users can use an RDP client such as Remmina or Vinagre.

VI. Conclusion

Configure a remote desktop that allows you to manage your Ubuntu 20.04 server from your local machine through an easy to use graphical interface.

This is the end of this article on how to install Xrdp server (remote desktop) on Ubuntu 20.04. For more information about installing Xrdp server on Ubuntu 20.04, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to connect to Alibaba Cloud Ubuntu 16.04 server from local Windows remote desktop

<<:  Detailed explanation of JavaScript upload file limit parameter case

>>:  Simple use of Vue bus

Recommend

Html/Css (the first must-read guide for beginners)

1. Understanding the meaning of web standards-Why...

CentOS7.5 installation tutorial of MySQL

1. First check whether the system has mysql insta...

Detailed explanation of common commands in Docker repository

Log in docker login Complete the registration and...

HTML+CSS to achieve text folding special effects example

This article mainly introduces the example of rea...

How to use Linux tr command

01. Command Overview The tr command can replace, ...

Time zone issues with Django deployed in Docker container

Table of contents Time zone configuration in Djan...

HTML sample code for implementing tab switching

Tab switching is also a common technology in proj...

Analysis and solution of a.getAttribute(href,2) problem in IE6/7

Brief description <br />In IE6 and 7, in a ...

Example method of deploying react project on nginx

Test project: react-demo Clone your react-demo pr...

Understanding the CSS transform-origin property

Preface I recently made a fireworks animation, wh...

Let's talk about the performance of MySQL's COUNT(*)

Preface Basically, programmers in the workplace u...

Detailed example of using case statement in MySQL stored procedure

This article uses an example to illustrate the us...

Native js to realize a simple snake game

This article shares the specific code of js to im...

JavaScript to achieve the effect of clicking on the submenu

This article shares the specific code of JavaScri...