installing xrdp on centos 5, centos 6 and ubuntu 13.10

Upload: daniel-nelson

Post on 17-Oct-2015

175 views

Category:

Documents


2 download

DESCRIPTION

Howo to install the open source RDP remote desktop server XRDP on CentOS 5, 6 and Ubuntu 13.10

TRANSCRIPT

Installing XRDP on Ubuntu 13.04Install needed Packages#apt-get install vnc4server autoconf automake libtool libssl-dev libpam0g-dev libx11-dev libxfixes-dev git gcc

Download and install the updated version of XRDP#cd /tmp

#git clone https://github.com/charlesvg/xrdp.git#mv xrdp /usr/lib/xrdp-v0.7-obasi

#cd /usr/lib/xrdp-v0.7-obasi

Now to install updated version of XRDP#./bootstrap#./configure#make

#make install

Generate custom rsakeys.ini#/usr/local/bin/xrdp-keygen xrdp auto

Configure session manager#nano w /etc/xrdp/sesman.ini

Edit the line to

AllowRootLogin=0

AssignSessionByUsername=1

Setup Users Groups#/usr/sbin/groupadd tsusers#/usr/sbin/groupadd tsadmins

Edit Groups file#nano -w /etc/group

Edit the following lines to look like this.tsusers:x:501:YOURUSERNAMEtsadmins:x:502:root

Now to setup VNC Password for the user that you want to use XRDP Services#su YOURUSERNAME#vncpasswd

Insert your password twice

#exit

To return root user

Start vnc4server#su YOURUSERNAME

#vnc4server -geometry 800x600

#killall Xvnc4

#nano -w ~/vnc/xstartup

Make the file look like this:

#!/bin/sh

# Uncomment the following two lines for normal desktop:

unset SESSION_MANAGER

# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

xsetroot -solid grey

vncconfig -iconic &

#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

#x-window-manager &

startxfce4 &

Starting xfce session with X : Fix gray screen issue#echo xfce4-session > /home/YOURUSERNAME/.xsession

Remove display environment variables#cat /home/YOURUSERNAME/.bashrc

Make sure there is no DISPLAY environment variable defined

#cat /home/YOURUSERNAME/.bash_profile

Make sure there is no DISPLAY environment variable defined

Now to hook XRDP and vnc4server to the rc.local file#nano -w /etc/rc.local

Add the following to the end of the file/etc/xrdp/xrdp.sh start

su YOURUSERNAME -c vnc4server -geometry 800x600 -depth 16

Copy keyboard settingscp /usr/lib64/xrdp-v0.7-obasi/instfiles/km-0813.ini /etc/xrdp/

Remove all modes from /etc/xrdp/xrdp.ini except xvnc...Turn on the services#/sbin/chkconfig vncserver on#/etc/xrdp/xrdp.sh start

Turn off terminal bellInstalling XRDP on Centos 5Stop NX#/sbin/chkconfig freenx-server off

#/etc/init.d/freenx-server stop

Install/Update EPEL & RPMforge#cd /tmp

#wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm#rpm -Uvh rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm

#rm -f rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm

#rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

Install needed Packages#yum install -y vnc-server autoconf automake libtool openssl-devel pam-devel libX11-devel libXfixes-devel git gcc

Download and install the updated version of XRDP#cd /tmp

#git clone https://github.com/charlesvg/xrdp.git#mv xrdp /usr/lib64/xrdp-v0.7-obasi

#cd /usr/lib64/xrdp-v0.7-obasi

Now to install updated version of XRDP#./bootstrap#./configure#make

#make install

Generate custom rsakeys.ini#/usr/local/bin/xrdp-keygen xrdp auto

Configure session manager#nano w /etc/xrdp/sesman.ini

Edit the line to

AllowRootLogin=0

AssignSessionByUsername=1

Setup Users Groups#/usr/sbin/groupadd tsusers#/usr/sbin/groupadd tsadmins

Edit Groups file#nano -w /etc/group

Edit the following lines to look like this.tsusers:x:501:YOURUSERNAMEtsadmins:x:502:root

Now to setup VNC Password for the user that you want to use XRDP Services#su YOURUSERNAME#vncpasswd

Insert your password twice

#exit

To return root user

Edit the VNC Server#nano -w /etc/sysconfig/vncservers

Insert at the end of fileVNCSERVERS="1:YOURUSERNAME"VNCSERVERARGS[1]="-geometry 1024x768 -depth 16"

Run VNC server to create xstartup script#/sbin/service vncserver start

Modify xstartup script to run a full blown desktop in VNC Server#nano -w /home/YOURUSERNAME/.vnc/xstartup

Uncomment following lines:

# unset SESSION_MANAGER

# exec /etc/X11/xinit/xinitrc

Remove display environment variables#cat /home/YOURUSERNAME/.bashrc

Make sure there is no DISPLAY environment variable defined

#cat /home/YOURUSERNAME/.bash_profile

Make sure there is no DISPLAY environment variable defined

#/sbin/service vncserver restart

Now to hook XRDP Server to the rc.local file#nano -w /etc/rc.local

Add the following to the end of the file/etc/xrdp/xrdp.sh start

Copy keyboard settingscp /usr/lib64/xrdp-v0.7-obasi/instfiles/km-0813.ini /etc/xrdp/

Remove all modes from /etc/xrdp/xrdp.ini except xvnc...Turn on the services#/sbin/chkconfig vncserver on#/etc/xrdp/xrdp.sh start

Turn off terminal bellIf on an Oracle Fusion AS, edit frmxml2f.sh

#nano -w /home/YOURUSERNAME/Oracle/Middleware/asinst_1/bin/frmxml2f.sh

Add a new line at the top (after #!/bin/bash) with the contents:

export DISPLAY=:1.0Installing XRDP on Centos 6

Stop NX (probably not installed on Centos 6)#/sbin/chkconfig freenx-server off

#/etc/init.d/freenx-server stop

Install/Update EPEL & RPMforge#rpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm#rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmInstall needed Packages#yum install -y tigervnc-server autoconf automake libtool openssl-devel pam-devel libX11-devel libXfixes-devel git gcc

Download and install the updated version of XRDP#cd /tmp

#git clone https://github.com/charlesvg/xrdp.git#mv xrdp /usr/lib64/xrdp-v0.7-obasi

#cd /usr/lib64/xrdp-v0.7-obasi

Now to install updated version of XRDP#./bootstrap#./configure#make

#make install

Generate custom rsakeys.ini#/usr/local/bin/xrdp-keygen xrdp auto

Configure session manager#nano w /etc/xrdp/sesman.ini

Edit the line to

AllowRootLogin=0

AssignSessionByUsername=1

Setup Users Groups#/usr/sbin/groupadd tsusers#/usr/sbin/groupadd tsadmins

Edit Groups file#nano -w /etc/group

Edit the following lines to look like this.tsusers:x:501:YOURUSERNAMEtsadmins:x:502:root

Now to setup VNC Password for the user that you want to use XRDP Services#su YOURUSERNAME#vncpasswd

Insert your password twice

#exit

To return root user

Edit the VNC Server#nano -w /etc/sysconfig/vncservers

Insert at the end of fileVNCSERVERS="1:YOURUSERNAME"VNCSERVERARGS[1]="-geometry 1024x768 -depth 16"

Run VNC server to create xstartup script#/sbin/service vncserver start

Remove display environment variables#cat /home/YOURUSERNAME/.bashrc

Make sure there is no DISPLAY environment variable defined

#cat /home/YOURUSERNAME/.bash_profile

Make sure there is no DISPLAY environment variable defined

#/sbin/service vncserver restart

Now to hook XRDP Server to the rc.local file#nano -w /etc/rc.local

Add the following to the end of the file/etc/xrdp/xrdp.sh start

Copy keyboard settingscp /usr/lib64/xrdp-v0.7-obasi/instfiles/km-0813.ini /etc/xrdp/

Remove all xrdp modes from /etc/xrdp/xrdp.ini except xrdp2 and rename xrdp2 to xrdp1Turn on the services#/sbin/chkconfig vncserver on#/etc/xrdp/xrdp.sh start

Turn off terminal bellIf on an Oracle Fusion AS, edit frmxml2f.sh

#nano -w /home/YOURUSERNAME/Oracle/Middleware/asinst_1/bin/frmxml2f.sh

Add a new line at the top (after #!/bin/bash) with the contents:

export DISPLAY=:1.0