Posts /

Access Ubuntu or Red Hat using Windows RDP

Twitter Facebook
22 Feb 2020

Introduction

To get access to Linux GUI in Windows we normally use VNC. However, this would require VNC configuration on Linux machine and VNC client on Window. In this tutorial we will see how to access Linux machine using Windows RDP by simply installing one package on Linux machine. For this we need:

  1. Any of one Linux Desktop Enviroment like Gnome, XFCE and KDE is installed on Linux machine.
  2. Require internet access on Linux machine.

Note: In all below commands, you can ignore sudo if you are using root user.

Install Packages

Ubuntu / Debian based

sudo apt-get update
sudo apt-get install xrdp tigervnc-server -y

RHEL / CentOS

sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum repolist
sudo yum install xrdp tigervnc-server -y

Start And Enable Service

Systemd

sudo systemctl start xrdp
sudo systemctl enable xrdp

SysVinit

sudo service xrdp start
sudo service xrdp enable

Check Service

Command

sudo netstat -tulpn

Output

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

Enable Firewall

Ubuntu / Debian based

sudo ufw allow 3389/tcp

RHEL / CentOS

sudo firewall-cmd --permanent --zone=public --add-port=3389/tcp
sudo firewall-cmd --reload

Enable SELinux

RHEL / CentOS

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

Test Connectivity

Remote Desktop Connection

RDC

XRDP

XRDP

Questions? Please do ask in comment section or find me on twitter


Twitter Facebook