Getting XRDP to Work on Linux
Created: 14 January 2016 Modified:My fellow programmers and I use XRDP, an open source Remote Desktop Protocol application, for remotely connecting to our workstations. Routinely during upgrades XRDP would stop working. Some time later, during a routine security scan, my workstation was assessed to have the CVE-2005-1794 vulnerability. CVE-2005-1794 is about a man in the middle attack being able to spoof public keys. This vulnerability exists on both Linux and Windows. The workstation I am working with is XFCE Fedora Core 23.
Having to redo the configurations a number of times, for myself and others, it seemed prudent to document the procedures. First let us look into getting XRDP to play nice with SELinux. SELinux uses extended file attributes to label files with a “Security Context”. For XRDP to work with SELinux we need to change the context of files xrdp and xrdp-sesman as shown below.
Change files security context
What happened is we used the change context command to change the type of the files. SELinux then allowing the files to be run. Unfortunately the changes above will likely not last if you reinstall or upgrade XRDP. To make the changes more permanent you would want to modify SELinux configuration to remember the changes.
Add file context configuration to SELinux configuration
Now that SELinux is out of the way, you will want to make sure port 3389 is open in your firewall. On my system I have Firewall and I added port 3389 under “Public” for both the “Runtime” and “Permanent” configurations.
Now lets look into securing XRDP from public key spoofing. We chose to create a self-signed certificate. For our purposes this will be perfectly adequate as only our team will be connecting to the workstations and we know they are trustworthy. First lets get our certificate. You will be prompted to answer a series of questions about the location and name of the server for which it is being created.
Generate a certificate
Once that is accomplished change the permissions of of the keys to protect them.
Generate a certificate
Next we modify the /etc/xrdp/xrdp.ini file to enable tls by changing “security_layer=rdp” to “security_layer=tls”. Finally we restart the XRDP service in order for the changes to take effect.
Restart XRDP
Update:
Due to a security scan hit on XRDP for not activating Network Level Authentication I had to forgo its use in favor of Tiger VNC. XRDP is aware of the issue but at this time we don’t know when a fix will be available.