Knowledgebase: VPS
XRDP : Installation and Configuration
Posted by Ryan Mendonca, Last modified by Ryan Mendonca on 17 May 2019 11:01:12 AM

What is XRDP.

xrdp 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).

Prerequisites for Installing XRDP.

1. Install Gnome

Step 1 (Optional): Run the following command to list down the available package groups
# yum group list

Step 2: Enable GUI on system startup.
# ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

Step 3: Reboot the machine to start the server in the graphical mode.
# reboot


Install xrdp on CentOS 6

Step 1: Use YUM command to install xrdp package
# yum -y install xrdp tigervnc-server

Step 2: Start XRDP service
# service xrdp start

Step 3: xrdp should now be listening on 3389. You can confirm this by using netstat command.
# netstat -antup | grep xrdp

Step 4: By default, xrdp service won’t start automatically after a system reboot. Run the following command in the terminal to enable the service at system startup.
# chkconfig xrdp on

Step 5: Configure the firewall to allow RDP connection from external machines. The following command will add the exception for RDP port (3389).
# iptables -I INPUT -p tcp -m tcp --dport 3389 -j ACCEPT
# service iptables save
# service iptables restart

Step 6: Configure SELinux

# chcon --type=bin_t /usr/sbin/xrdp
# chcon --type=bin_t /usr/sbin/xrdp-sesman

Step 7: Now take RDP from any windows machine using Remote Desktop Connection. Enter the ip address of Linux server in the computer field and then click on connect.

Install xrdp on CentOS 7

Step 1: Use YUM command to install xrdp package on CentOS 7 / RHEL 7

# yum -y install xrdp tigervnc-server

Step 2: Once xrdp is installed, start the xrdp service using the following command

# systemctl start xrdp

Step 3: xrdp should now be listening on 3389. Confirm this by using netstat command

# netstat -antup | grep xrdp

Step 4: By default, xrdp service won’t start automatically after a system reboot. Run the following command in the terminal to enable the service at system startup

# systemctl enable xrdp

Step 5: Configure the firewall to allow RDP connection from external machines. The following command will add the exception for RDP port (3389)

# firewall-cmd --permanent --add-port=3389/tcp
# firewall-cmd --reload

Step 6: Configure SELinux
# chcon --type=bin_t /usr/sbin/xrdp
# chcon --type=bin_t /usr/sbin/xrdp-sesman

Step 7: Now take RDP from any windows machine using Remote Desktop Connection. Enter the ip address of Linux server in the computer field and then click on connect.

(0 vote(s))
Helpful
Not helpful

Comments (0)