CentOS

Xrdp on CentOS 8

What is Xrdp?

It is an open-source project that allows the graphical access of a remote system using the RDP (Microsoft Remote Desktop Protocol). It is a potent tool because it can create real-time desktop sessions just like you can do on your local machine. This article will help you with setting up the Xrdp on CentOS 8.

How to Set Up xrdp on CentOS 8

Prerequisites

Before installing the Xrdp server, you are required to install the desktop environment. The default Desktop environment for CentOS is Gnome.

Use this command to install it:

# sudo dnf groupinstall "Server with GUI"

Enable EPEL on your system if it isn’t already enabled using the following command:

# sudo dnf install epel-release

Install xrdp

Execute the following command to install xrdp:

# sudo dnf install xrdp

After the installation is complete, start the Xrdp server and enable the Xrdp on boot:

# sudo systemctl enable xrdp -- now

Verify if the Xrdp is running:

# sudo systemctl status xrdp

Customizing Xrdp

The editable files of Xrdp are located in the etc/xrdp folder. For normal connections, you won’t need to make any amendments. But if the changes are to be made necessarily, then the main configuration file is xrdp.ini.

After making changes, you are required to restart the xrdp server again:

# sudo systemctl restart xrdp

Configure Firewall

Xrdp is set on port 3389 by default. If you are running the firewall on your local CentOS machine, you will need to add protocols to allow traffic on the Xrdp port.

Generally, access of Xrdp server is desirable through a particular IP address or specific IP range. Considering an example that you want the connections from the 192.172.2.0/52 range, execute the given command:

# sudo firewall-cmd --new-zone=xrdp --permanent
# sudo firewall-cmd --zone=xrdp --add-port=3389/tcp     --permanent
# sudo firewall-cmd --zone=xrdp --add-source=192.168.1.0/24 --permanent
# sudo firewall-cmd --reload

Giving access from which particular set of rules is generally not an ideal task to do, but to do that, run the following command:

# sudo firewall-cmd --add-port=3389/TCP --permanent
# sudo firewall-cmd --reload

To increase security, setting up Xrdp to listen just on localhost and making an SSH tunnel that safely advances traffic from your nearby machine on port 3389 to the worker on a similar port is a good option.

Or install VPN and connect to the server using a private network.

Connecting to the Xrdp Server

After setting up the server, connect it remotely but remember that windows users are required to open “Remote Desktop Connection” from the windows search bar. After opening it, you will get a pop-up, and it is the RDP client. Type the IP address set up in the “Computer” column and choose the “connect” button. Now, provide your username and password, fill in these details and click “OK.”

Once you are done, you will see Gnome Desktop. Now you have got all the access to the machine on which you have set up the server.

You can install RDP on your mac and start using the remote connection from your Mac device too. For Linux users, you can use RDP clients like Vinagre or Remmina.

Conclusion

Xrdp is an excellent server considering all the benefits and security features. Even setting it up is an easy task. Hopefully, this article has helped you in setting up your server on your local machine. For more such informative articles, bookmark our website.

About the author

Ankit Sharma