daily pastebin goal
45%
SHARE
TWEET

XRDP

a guest Sep 22nd, 2016 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ################################################################
  2. # Script_Name : xrdp-install.sh
  3. # Description : Perform an automated custom installat of xrdp
  4. # on ubuntu 15.04 when systemd is used
  5. # Date : May 2015
  6. # written by : Griffon
  7. # Web Site :http://www.c-nergy.be – http://www.c-nergy.be/blog
  8. # Version : 1.4
  9. #
  10. # Disclaimer : Script provided AS IS. Use it at your own risk….
  11. #
  12. ##################################################################
  13.  
  14. #-Go to your Download folder
  15.  
  16. echo “Moving to the ~/Download folders…”
  17. echo “———————————–”
  18. cd ~/Downloads
  19.  
  20. #Download the xrdp latest files
  21. echo “Ready to start the download of xrdp package”
  22. echo “——————————————-”
  23.  
  24. wget https://github.com/neutrinolabs/xrdp/archive/master.zip
  25.  
  26. #Unzip xrdp package
  27.  
  28. echo “Extracting content of xrdp package…”
  29. echo “———————————–”
  30. unzip master.zip
  31.  
  32. #Install prereqs for compilation
  33.  
  34. echo “Installing prereqs for compiling xrdp…”
  35. echo “—————————————-”
  36. sudo apt-get -y install autoconf libtool libpam0g-dev libx11-dev libxfixes-dev libssl-dev libxrandr-dev
  37.  
  38. #Install the desktop of you choice – I’m Using Mate Desktop
  39.  
  40. echo “Installing alternate desktop to be used with xrdp…”
  41. echo “—————————————————-”
  42. sudo apt-get -y update
  43. sudo apt-get -y install mate-core mate-desktop-environment mate-notification-daemon –force-yes
  44. echo “Desktop Install Done”
  45. #Configure the Xsession file
  46. echo mate-session> ~/.xsession
  47.  
  48. #Install the X11VNC
  49. echo “Installing X11VNC…”
  50. echo “—————————————-”
  51.  
  52. sudo apt-get -y install x11vnc
  53.  
  54. #Add/Remove Ubuntu xrdp packages (used to create startup service)
  55.  
  56. echo “Add/Remove xrdp packages…”
  57. echo “—————————”
  58.  
  59. sudo apt-get -y install xrdp
  60. sudo apt-get -y remove xrdp
  61.  
  62. #Compile and make xrdp
  63.  
  64. echo “Installing and compiling xrdp…”
  65. echo “——————————–”
  66.  
  67. cd xrdp-master
  68. # needed because libtool not found in Ubuntu 15.04
  69. # Need to use libtoolize
  70.  
  71. sudo sed -i.bak ‘s/which libtool/which libtoolize/g’ bootstrap
  72.  
  73. sudo ./bootstrap
  74. sudo ./configure
  75. sudo make
  76. sudo make install
  77.  
  78. #Final Post Setup configuration
  79. echo “—————————”
  80. echo “Post Setup Configuration…”
  81. echo “—————————”
  82.  
  83. echo “Set Default xVnc-Sesman”
  84. echo “———————–”
  85.  
  86. sudo sed -i.bak ‘/\[xrdp1\]/i [xrdp0] \nname=Xvnc-Sesman-Griffon \nlib=libvnc.so \nusername=ask \npassword=ask \nip=127.0.0.1 \nport=-1 \ndelay_ms=2000’ /etc/xrdp/xrdp.ini
  87.  
  88. echo “Symbolic links for xrdp”
  89. echo “———————–”
  90.  
  91. sudo mv /etc/xrdp/startwm.sh /etc/xrdp/startwm.sh.backup
  92. sudo ln -s /etc/X11/Xsession /etc/xrdp/startwm.sh
  93. sudo mkdir /usr/share/doc/xrdp
  94. sudo cp /etc/xrdp/rsakeys.ini /usr/share/doc/xrdp/rsakeys.ini
  95.  
  96. ## Needed in order to have systemd working properly with xrdp
  97. echo “———————–”
  98. echo “Modify xrdp.service ”
  99. echo “———————–”
  100.  
  101. #Comment the EnvironmentFile – Ubuntu does not have sysconfig folder
  102. sudo sed -i.bak ‘s/EnvironmentFile/#EnvironmentFile/g’ /lib/systemd/system/xrdp.service
  103.  
  104. #Replace /sbin/xrdp with /sbin/local/xrdp as this is the correct location
  105. sudo sed -i.bak ‘s/sbin\/xrdp/local\/sbin\/xrdp/g’ /lib/systemd/system/xrdp.service
  106. echo “———————–”
  107. echo “Modify xrdp-sesman.service ”
  108. echo “———————–”
  109.  
  110. #Comment the EnvironmentFile – Ubuntu does not have sysconfig folder
  111. sudo sed -i.bak ‘s/EnvironmentFile/#EnvironmentFile/g’ /lib/systemd/system/xrdp-sesman.service
  112.  
  113. #Replace /sbin/xrdp with /sbin/local/xrdp as this is the correct location
  114. sudo sed -i.bak ‘s/sbin\/xrdp/local\/sbin\/xrdp/g’ /lib/systemd/system/xrdp-sesman.service
  115.  
  116. #Issue systemctl command to reflect change and enable the service
  117. sudo systemctl dameon-reload
  118. sudo systemctl enable xrdp.service
  119.  
  120. echo “Restart the Computer”
  121. echo “—————————-”
  122. sudo shutdown -r now
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top