RHEL/CentOS7 xrdp auto disconnects when logging on

So I ran into an issue this week with XRDP disconnecting from my RHEL/CentOS7 RDP connection the moment the logon process is finished. Searching around for different answers to this solution there seems to be no one way of doing it. So I decided to tell you what I did to fix the issue and hopefully help you avoid a major headache in the future.


I will start with the installation of XRDP and go through the changes.

  1. Install xrdp tigervnc-server on your RHEL/CentOS7 box
user@computer:$ yum -y install xrdp tigervnc-server

2. Start xrdp service and enable at boot

user@computer:$ systemctl enable xrdp
user@computer:$ systemctl start xrdp

3. Allow 3389 through the firewall and reload firewall

user@computer:$ firewall-cmd --permanent --zone=public --add-port=3389/tcp
user@computer:$ firewall-cmd --reload

4. Configure SELinux ( I did not need to perform this step)

user@computer:$ chcon --type=bin_t /usr/bin/xrdp
user@computer:$ chcon --type=bin_t /usr/bin/xrdp-sesman

5. Edit the xrdp.ini file located at the /etc/xrdp/xrdp.ini

user@computer:$ vi /etx/xrdp/xrdp.ini

6. Comment out the line that says ā€œChannel_code=1ā€ Here is a example of the .ini file after the change is made



Just a FYI also some of these commands I did not come up with and where figured out from other blogs. Which when I get permission from the owners I will post here.

That being said this is my first post into some real enterprise level Linux! If you have any tip or tricks as i go down the RHEL CentOS path let me know!

Resources i used:

Install xrdp on CentOS 7 / RHEL 7

Leave a Reply

Your email address will not be published. Required fields are marked *