configure xrdp in centOS

Sometimes it becomes worthy and cozy to handle linux machines from windows. To get rid of such situation, we can configure packages in linux machines to allow remote desktop from windows machines like we connect windows machines from windows machines using a client named remote desktop or mstsc. XRDP is a cross platform to connect between windows machines and linux machines.

lets begin with the installation and configurations for xrdp.
1. Make sure necessary packages are installed.
Packages required are:
xrdp, tiger-vncserver, autoconf, automake, libtool, openssl-devel, pam-devel, libX11-devel, libXfixes-devel
[root@gyasu Downloads]# yum -y install tiger-vncserver, autoconf, automake, libtool, openssl-devel, pam-devel, libX11-devel, libXfixes-devel

2. Download and install core package xrdp from sourceforge.net or google. After download move to the download directory and untar the file.
[root@gyasu Downloads]# tar -zxvf xrdp-v0.6.1.tar.gz
[root@gyasu Downloads]# cd xrdp-v0-6.1
[root@gyasu xrdp-v0.6.1]# ./bootstrap
[root@gyasu xrdp-v0.6.1]# ./configure
[root@gyasu xrdp-v0.6.1]# make
[root@gyasu xrdp-v0.6.1]# make install
This way main installation finishes and the next part is user administration part.

3. Add users and groups
[root@gyasu xrdp-v0.6.1]# groupadd normal-users
[root@gyasu xrdp-v0.6.1]# groupadd admin-users
[root@gyasu xrdp-v0.6.1]# vi /etc/group

## And make the changes as belows to give access from windows machines
normal-users:x:501:gsuwal
admin-users:x:502:root

4. Assign user priveleges
[root@gyasu xrdp-v0.6.1]# su - gsuwal
[gsuwal@gyasu ~]$ vncpasswd 
Password:
Verify:
[gsuwal@gyasu ~]$ 

Now return to the root user to modify vncserver settings
[gsuwal@gyasu ~]$ exit
logout
[root@gyasu xrdp-v0.6.1]# 
[root@gyasu xrdp-v0.6.1]# vi /etc/sysconfig/vncservers 
## make the following changes at the end of the file
vi /etc/sysconfig/vncservers

VNCSERVERS="1:gsuwal"
VNCSERVERARGS[1]="-geometry 1280x960 -depth 16"

## gsuwal is your desired username in linux used from windows machine to connect to linux machine
## geometry is the resolution and depth 16 is the connection bit

Now make sure the xrdp server runs automatically after each reboot by adding to local.repo
[root@gyasu xrdp-v0.6.1]# vi /etc/rc.local
## And append the service command, save and quit
/etc/xrdp/xrdp.sh start

Save everything, restart all the processes.
[root@gyasu xrdp-v0.6.1]# /etc/xrdp/xrdp.sh start
xrdp is already loaded
[root@gyasu xrdp-v0.6.1]# chkconfig vncserver start
[root@gyasu xrdp-v0.6.1]# service vncserver restart

Hence, we can easily connect to linux machines from windows machine successfully.

Note: tested successfully in centOS 6