How To RDP into CentOS 7 from Windows

Published: January 30, 2018 (Updated: Jan 30, 2018)

Enjoying this content? Subscribe to the Channel!

Unlock Your Linux Desktop: How to RDP into CentOS 7 from Windows (The Easy Way!)

Welcome back to Darren’s Tech Tutorials!

Are you running a CentOS 7 server but wish you could manage it using the familiar graphical user interface (GUI) directly from your Windows desktop? You’re in the right place!

While Linux administrators often rely on the command line, sometimes you just need the visual convenience of the CentOS desktop environment. This guide walks you through the straightforward process of setting up Remote Desktop Protocol (RDP) connectivity on your CentOS 7 server, allowing seamless access from any Windows machine.

We’ll be using the powerful xrdp software package, making the connection feel just like accessing another Windows computer. Get ready to bridge the gap between Windows and Linux!


Before we dive in, remember you can access the original full text tutorial with all commands here, and if you’re looking to sharpen your Linux skills, grab my free Linux cheat sheet here.

Step 1: Preparing Your CentOS 7 Server and Adding Repositories

The first crucial step is ensuring your CentOS system has access to the necessary software repositories that host the xrdp package. We typically rely on the Extra Packages for Enterprise Linux (EPEL) repository for this.

1. Install the EPEL Repository: Log into your CentOS 7 server via SSH or the local console and execute the following command:

sudo yum install epel-release -y

This command installs the EPEL repository configuration, allowing yum (the package manager) to find and download the xrdp software in the next step.

2. Update Your System (Recommended): It’s always a good practice to ensure your existing packages are up to date before installing new software:

sudo yum update -y

Step 2: Installing the Necessary RDP Software (xrdp)

With the EPEL repo in place, we can now install xrdp—the open-source RDP server that allows remote connections—and its dependencies.

1. Install xrdp:

sudo yum install xrdp tigervnc-server -y

Note: We often install tigervnc-server alongside xrdp as it provides the necessary VNC back-end that xrdp uses to handle the graphical sessions.

2. Start and Enable the xrdp Service: We need to ensure the xrdp service is running immediately and that it starts automatically every time your server reboots.

sudo systemctl start xrdp
sudo systemctl enable xrdp

3. Verify Status: You can quickly check if the service is active and running:

sudo systemctl status xrdp

You should see an “active (running)” status.

Step 3: Configuring the Firewall for RDP Access

By default, the firewall on CentOS 7 (FirewallD) will block external connections to port 3389, which is the standard port used by RDP. We must explicitly open this port to allow connections from your Windows PC.

1. Add the RDP Service Rule: We will add a permanent rule to allow traffic on port 3389 (the RDP default port).

sudo firewall-cmd --permanent --add-port=3389/tcp

2. Reload the Firewall Configuration: For the new rule to take effect immediately without rebooting the server, you must reload the firewall:

sudo firewall-cmd --reload

Your CentOS 7 server can now receive connection requests on the standard RDP port!

Step 4: Securing Connections with SELinux

Security-Enhanced Linux (SELinux) is a powerful mandatory access control system that often blocks network access, even if the firewall is configured correctly, because it sees the RDP service trying to communicate outside of its predefined permissions.

If you skip this step, SELinux may silently block the connection, leaving you wondering why your RDP connection fails.

1. Set the SELinux Boolean for RDP: We need to configure SELinux to allow xrdp to read and write to the necessary files and network ports.

sudo chcon --type=bin_t /usr/sbin/xrdp
sudo chcon --type=bin_t /usr/sbin/xrdp-sesman
sudo setsebool -P allow_rdp on

By completing this final security configuration, you ensure SELinux does not interfere with the remote desktop process.

Connecting from Windows to CentOS 7

You are now ready to connect!

  1. Open Remote Desktop Connection: On your Windows PC (whether Windows 7, 10, or 11), open the “Remote Desktop Connection” application (you can search for RDP).
  2. Enter Server IP: Input the IP address or hostname of your CentOS 7 server.
  3. Log In: When prompted by the xrdp connection window, enter your CentOS username and password.

You should now be presented with the CentOS GUI desktop, running remotely on your Windows machine!


Conclusion: Remote Linux Access, Achieved!

That’s all there is to it! By following these four steps—installing the necessary software, setting up the firewall, and tweaking SELinux—you have successfully enabled Remote Desktop connectivity to your CentOS 7 server. This dramatically simplifies managing your Linux GUI applications directly from the comfort of your Windows environment.

We hope this tutorial made the process clear and easy to follow. If you found this guide helpful, please give this post a share and remember to Like the original video and Subscribe to Darren’s Tech Tutorials for more accessible technology guides! Drop a comment below if you have any questions—I’m always happy to help!