In order to RDP to your Linux server from Windows, we can use xrdp. Xrdp is an open source remote desktop protocol server that is capable of accepting connections from rdesktop, freerdp, and remote desktop clients. In this guide we will help you to set up xrdp server in CentOS 7.
Install xrdp on CentOS 7
Step 1: Do not forget to install Gnome on CentOS 7.
Step 2: Install and configure the EPEL repository using below command:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Step 3: Add a nux repository using the following command:
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
Step 4: Use Yum command to install xrdp and tigervnc-server.
yum -y install xrdp tigervnc-server
Step 5: start the xrdp service using the following command:
systemctl start xrdp.service
Step 6: xrdp will listen on 3389, confirm this by issuing the following command.
# netstat -antup | grep xrdp
Output should be below:
tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN 1508 / xrdp
tcp 0 0 127.0.0.1:3350 0.0.0.0:* LISTEN 1507 / xrdp-sesman
Step 7: Issue the following command to enable the service at system startup.
systemctl enable xrdp.service
Step 8: Using the following commands Create iptables rule to allow RDP connection from external machines.
firewall-cmd --permanent --zone = public --add-port = 3389 / tcp
Step 9: Configure SELinux using the following commands:
# chcon --type = bin_t / usr / sbin / xrdp # chcon --type = bin_t / usr / sbin / xrdp-sesman
Test Remote Connectivity
Now open the Remote Desktop Connection utility from your Windows machine, enter the IP address of the Linux server in the computer field and click on connect.
It will ask to enter the user name and password. You can use root or any other Linux system user. Make sure you use module "sesman-xvnc".
If you click ok, you will get a desktop.
That's all You have successfully installed xrdp on CentOS 7 . If you are facing any problem with the installation, feel free to comment here. Our team will help you to solve the issue.