Xrdp is the Microsoft Remote Desktop Protocol (RDP) open source implementation that allows you to graphically control the remote system. Use RDP, you can log on to a remote computer and create a real desktop session, just as you are logged on to the local computer.
Open source solution if you want to remote desktop access, use VNC .
Installing the Desktop environment
Usually, Linux server does not install a desktop environment. Our first step is to install a lightweight X11 desktop environment and will act as the back-end Xrdp.
Ubuntu repository has several desktop environment (DE). We will install Xfce. It is a fast, stable and lightweight desktop environment, ideal for use on a remote server.
As a user with sudo privileges, type the following command to install Xfce on the server:
sudo apt update sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils
Depending on your system, download and install Xfce packages take some time.
Installation Xrdp
Xrdp packages are available in the default Ubuntu repositories. To install it, run:
sudo apt install xrdp
After the installation process is complete, Xrdp service will start automatically. You can verify this by typing the following if Xrdp running:
sudo systemctl status xrdp
The output looks like this:
● xrdp.service - xrdp daemon Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2019-07-28 22:40:53 UTC; 4min 21s ago Docs: man:xrdp(8) man:xrdp.ini(5) ...
Configuration Xrdp
Xrdp configuration file located in / etc / xrdp directory. For basic Xrdp connection, we only need to configure Xrdp to use Xfce. To do this, open the following file in a text editor:
File /etc/xrdp/xrdp.ini
sudo nano /etc/xrdp/xrdp.ini
Add the following line at the end of the file:
exec startxfce4
Save the file and restart Xrdp services:
sudo systemctl restart xrdp
Configure the firewall
By default, Xrdp listening 3389 port on all interfaces. If you are running a firewall (you should always do so) on Ubuntu server, you need to add a rule to enable traffic on Xrdp port.
To allow access to Xrdp server from a specific IP address or IP range, in this example 192.168.1.0/24 run the following command:
sudo ufw allow from 192.168.1.0/24 to any port 3389
If you want to allow access from anywhere (for security reasons and is strongly discouraged), run:
sudo ufw allow 3389
To improve security, you can consider setting Xrdp forwarded to the server on the same port and listens only to create a SSH tunnel on localhost, the tunnel will be safe from traffic on port 3389 of the local computer. Another option is to install OpenVPN security and connect to the server via a dedicated network Xrdp.
Connect to the server Xrdp
Now that you've set up Xrdp server, it is time to open Xrdp client and connect to the server.
If you are a Windows user, you can use the default RDP client. Type "remote" in the Windows search bar and click "Remote Desktop Connection." This will open the RDP client. Enter the remote server IP address in the computer field, and then click "Connect."
Enter your login screen in the user name and password, and then click "OK."
After logging in, you should see a default Xfce desktop. It should look like this:
You can now start using the keyboard and mouse to interact with the remote XFCE Desktop from the local computer.
in conclusion
Installation Xrdp service allows you to use easy-to-use graphical interface from Desktop Computer Management Ubuntu 18.04 server.