xrdp is a free open-source remote desktop server for Linux.
Installing xrdp on CentOS might be a little tricky since CentOS repositories does not contain the xrdp package.
Even the EPEL repository (Extra Packages Enterprise Linux) only contains an old version of xrdp.
CentOS xrdp HowTo
Add EPEL repo
First you need to add the EPEL repository that has an older version of xrdp.
rpm -Uvh http://ftp.uni-bayreuth.de/linux/fedora-epel/6/i386/epel-release-6-8.noarch.rpm
Install xrdp from EPEL repo
yum install xrdp -y
yum install tiger-vncserver autoconf automake libtool openssl-devel pam-devel libX11-devel libXfixes-devel -y
Download and install xrdp from source
Now that you have the older version of xrdp installed you can easily compile the latest version on top of the old one.
Download xrdp from sourceforge http://sourceforge.net/projects/xrdp/files/ to /opt folder.
extract the content of the file
tar -xvzf xrdp-v0.6.1.tar.gz
compile and install xrdp:
cd xrdp-v0.6.1 ./bootstarp ./configure make make install
start xrdp and make sure it is set to run at startup:
service xrdp start chkconfig xrdp on
Customize xrdp settings
The xrdp service config files are located at ‘/etc/xrdp/’:
We will edit these three:
/etc/xrdp/xrdp.ini /etc/xrdp/sesman.ini /etc/xrdp/startwm.sh
Remove login options
Edit ‘/etc/xrdp/xrdp/ini’ and delete from xrdp2 block to the end of the file leaving only the xrdp1 option.
Limit access to certain group
Edit ‘/etc/xrdp/sesman.ini’ and change ‘TerminalServerUsers=tsusers’ to the group name you wan to allow access.
If unset or set to an invalid or non-existent group, login for all users is enabled.
Add environment variables
xrdp has a different set of environment variables than regular bash session.
Edit ‘/etc/xrdp/startwm.sh’ and add at the beginning of the file the environment variables you want.
for example add ‘/bin’ and ‘/sbin’ to the PATH variable:
Set session limits to avoid login failed error
Edit ‘/etc/xrdp/sesman.ini’ and change ‘MaxSessions=10’ to ‘MaxSessions=100’