How to Install Xrdp Server (Remote Desktop) on CentOS 6/7

Xrdp is an open-source software,provides a graphical login to remote machines using RDP (Microsoft Remote Desktop Protocol). xrdp accepts connections from variety of RDP clients: FreeRDP, rdesktop, NeutrinoRDP and Microsoft Remote Desktop Client (for Windows, macOS, iOS and Android).

This tutorial explains how to install and configure Xrdp server on CentOS 6/7.

Prerequisites

Installing Desktop Environment

By default, CentOS uses GNOME as the desktop.If your CentOS server does not have a desktop environment installed,Our first step is to install X11 and a lightweight desktop environment that will act as a backend for Xrdp.

Type the following commands as a root user:

yum install epel-release
yum groupinstall "X Window system"
yum groupinstall xfce

Installing Xrdp

Xrdp package is available in the default CentOS repositories. Type the following command:

yum install xrdp

Once the installation process is complete,you can start xrdp server.

#centos 6
service xrdp start 
#centos 7 
systemctl start xrdp

You can verify that Xrdp is running by typing:

#centos 6 
service xrdp status
#centos 7
systemctl status xrdp

Set the Xrdp service to automatically start by typing:

#centos 6 
service xrdp enable
systemctl enable xrdp

Configuring Firewall

By default, Xrdp listens on port 3389 on all interfaces. If you run a firewall on your Ubuntu server , you’ll need to add a rule that will enable traffic on the Xrdp port.

#centos 6
iptables -I INPUT -p tcp --dport 3389 -j ACCEPT
service iptables save
service iptables restart
#centos 7
firewall-cmd --zone=public  --add-port=3389/tcp --permanent
systemctl restart firewalld.service

Connecting to the Xrdp Server

Now you can open your 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 on “Remote Desktop Connection”. This will open up the RDP client.

In the login screen enter your username and password and click “OK”.

Once logged in you should see the default Gnome desktop. It should look something like this:

Conclusion

Installing an Xrdp server allows you to manage your CentOS server from your local desktop machine using an easy to use graphic interface.

If you have questions feel free to leave a comment below.

Leave a Reply