Last active
July 13, 2018 09:45
-
-
Save bspavel/452704c7a7465a01898f4c0e7e6ae232 to your computer and use it in GitHub Desktop.
Guacamole installer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$(whoami)" != "root" ]; then | |
echo "Run script as ROOT please. (sudo !!!)" | |
exit | |
fi | |
# ------------------------------ | |
if [ -z "$JAVA_HOME" ]; then | |
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 | |
fi | |
# ------------------------------ | |
cd /opt/ | |
apt-get -y install \ | |
fail2ban git build-essential htop mc maven \ | |
libcairo2-dev libjpeg62-dev libpng-dev \ | |
libossp-uuid-dev tomcat8 openjdk-8-jdk \ | |
openjdk-8-jre libfreerdp-dev libpango1.0-dev \ | |
libssh-dev libssh2-1-dev libssl-dev \ | |
libtelnet-dev libvorbis-dev libwebp-dev \ | |
libavcodec-dev libavutil-dev libswscale-dev \ | |
libvncserver-dev libpulse-dev | |
wget http://sourceforge.net/projects/guacamole/files/current/source/guacamole-server-0.9.9.tar.gz | |
wget http://sourceforge.net/projects/guacamole/files/current/binary/guacamole-0.9.9.war | |
wget http://sourceforge.net/projects/guacamole/files/current/source/guacamole-client-0.9.9.tar.gz | |
tar -xvf guacamole-*tar.gz | |
cd guacamole-client-0.9.9 | |
mvn package | |
cd ../guacamole-server-0.9.9 | |
./configure --with-init-dir=/etc/init.d | |
read -n 1 -s -r -p "Press any key to install" | |
make && make install | |
mkdir /etc/guacamole/ && cd /etc/guacamole/ && touch /etc/guacamole/guacamole.properties | |
ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat8/lib/guacamole.properties | |
touch /etc/guacamole/user-mapping.xml | |
cat >> /etc/guacamole/guacamole.properties << "EOF" | |
guacd-hostname: localhost | |
guacd-port: 4822 | |
# Auth provider class (authenticates user/pass combination, needed if using the provided login screen) | |
auth-provider: net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvider | |
basic-user-mapping: /etc/guacamole/user-mapping.xml | |
EOF | |
cat >> /etc/guacamole/user-mapping.xml << "EOF" | |
<pre class="wrap:true lang:sh decode:true " > | |
<user-mapping> | |
<authorize username="admin" password="21232f297a57a5a743894a0e4a801fc3" encoding="md5"> | |
<connection name="RDP-TS01_by_username|passw"> | |
<protocol>rdp</protocol> | |
<param name="hostname">hostname</param> | |
<param name="username">username</param> | |
<param name="password">password</param> | |
<param name="domain">Domain_Name</param> | |
<param name="port">3389</param> | |
<param name="security">any</param> | |
<param name="ignore-cert">true</param> | |
</connection> | |
<connection name="RDP-TS02_without_login_req"> | |
<protocol>rdp</protocol> | |
<param name="hostname">hostname</param> | |
<param name="domain">Domain_Name</param> | |
<param name="port">3389</param> | |
</connection> | |
<connection name="ROUTER_SSH"> | |
<protocol>ssh</protocol> | |
<param name="hostname">hostname</param> | |
<param name="port">22</param> | |
</connection> | |
</authorize> | |
</user-mapping> | |
EOF | |
#------------------------------------------------------- | |
ldconfig | |
/etc/init.d/tomcat8 restart | |
/etc/init.d/guacd restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment