TASTE-OF-IT

Apache Guacamole – Remotedesktop Gateway Installation

Apache Guacamole

Apache Guacamole

Im Januar wurde die Version 1.0.0 des Remote-Desktop-Gateway, Apache Guacamole, veröffentlicht. Apache Guacamole ist ein Remote Desktop Gateway, dass dank der Nutzung von HTML5, ohne jeglichen Client oder Plugin auskommt. Es kann Verbindungen zu VNC Servern, Servern die das Remotedesktop Protokoll RDP unterstützen, Telnet und SSH Verbindungen aufbauen. Dadurch können Remotedesktopverbindungen von überall aus aufgebaut werden. Es wird lediglich eine Netzwerkverbindung zum Ziel und ein Webbrowser benötigt. Das tolle an Apache Guacamole ist dass es Open-Source ist und unter der Apache Lizenz V2, steht. Wer Apache Guacamole im Businessumfeld einsetzen möchte, der kann auf eine der Supportfirmen für Enterprise Kunden, zurückgreifen.

Webseite des Projektes: https://guacamole.apache.org/

Nachfolgend werde ich die Installation unter einem frisch installiertem Debian 10 Buster als Netinstall beschreiben. Grundsätzlich scheint Guacamole noch auf die ältere Version Stretch ausgelegt zu sein, denn einige neuere Pakete aus Buster werden nicht unterstützt. Dennoch bekommt man es unter Debian 10 zum laufen.

Debian Voraussetzungen installieren

Folgende Pakete sollten grundlegend installiert sein:

# apt install build-essential apt-transport-https unzip

Installation von MariaDB und Tomcat

Apache Guacamole benötige sowohl eine MariaDB als auch den Tomcat Webserver.

# apt install tomcat9 mariadb-server -y
# mysql_secure_installation
Change the root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!
Remove anonymous users? [Y/n] y
 ... Success!
Disallow root login remotely? [Y/n] y
 ... Success!
Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
Reload privilege tables now? [Y/n] y
 ... Success!
Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

Test Tomcat Installation

Im Browser http://servername:8080 sodass bei erfolgreicher Installation “It works!” angezeigt wird.

Guacamole Verzeichnisse erstellen

# mkdir -p /etc/guacamole/{extensions,lib}

Guacamole Datenbank erstellen

# mysql -u root -p
mysql> CREATE DATABASE guacamole_db; 
mysql> CREATE USER 'guacamole_user'@'localhost' IDENTIFIED BY 'dein_passwort';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit;
Bye

Debian Stretch Repo für libfreerdp-dev hinzufügen

Die aktuelle Version von Apache Guacamole kann nicht unter Debian 10 (Buster) installiert werden. Es gibt einige Pakete die noch nicht umgestellt wurden, sodass auf das Repo von Stretch zurück gegriffen werden muss.

# echo "# Stretch Repo wegen libfreerdp-dev" >> /etc/apt/sources.list
# echo "deb https://deb.debian.org/debian stretch main" >> /etc/apt/sources.list
# apt update
# apt install libfreerdp-dev

Java Database (JDBC) Treiber für MariaDB

Ist nur in Stretch vorhanden.

# apt install libmysql-java
# ln -s /usr/share/java/mysql-connector-java.jar /etc/guacamole/lib/

JDBC Guacamole Authentication Komponente

# cd /usr/src/guacamole/
# wget 'http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/1.0.0/binary/guacamole-auth-jdbc-1.0.0.tar.gz' -O guacamole-auth-jdbc-1.0.0.tar.gz
# tar -xzvf guacamole-auth-jdbc-1.0.0.tar.gz
# mv guacamole-auth-jdbc-1.0.0/mysql/guacamole-auth-jdbc-mysql-1.0.0.jar /etc/guacamole/extensions/

MySQL JDBC Treiber Schemas in Guacamole Database importieren

# cat guacamole-auth-jdbc-1.0.0/mysql/schema/*.sql | mysql -u root -p guacamole_db

Installation benötigten Guacamole Komponenten

# apt install -y  gcc-8 g++-8 libcairo2-dev libjpeg62-turbo-dev libpng-dev libossp-uuid-dev

Installation auswählbarer Guacamole Komponenten

# apt install -y libavcodec-dev libavutil-dev libswscale-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev libvorbis-dev libwebp-dev freerdp2-dev

Guacamole Server Installation

### klappt nicht, bekannter Fehler bei Ausführung von make
# wget "http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/1.0.0/source/guacamole-server-1.0.0.tar.gz" -O guacamole-server-1.0.0.tar.gz
# tar -xzvf guacamole-server-1.0.0.tar.gz
# cd guacamole-server-1.0.0/
# ./configure --with-init-dir=/etc/init.d
# make && make install
### bis hier dann mit Git

# latest Version from Git Hub
# apt install git dh-autoreconf
# git clone git://github.com/apache/guacamole-server.git
# cd guacamole-server/
# autoreconf -fi
oder
# wget "https://github.com/apache/guacamole-server/archive/staging/1.1.0.zip" -O guacamole-server-1.1.0.zip
# unzip guacamole-server-1.1.0.zip

# ./configure --with-init-dir=/etc/init.d
------------------------------------------------
guacamole-server version 1.1.0
------------------------------------------------

   Library status:

     freerdp ............. yes
     pango ............... yes
     libavcodec .......... yes
     libavutil ........... yes
     libssh2 ............. yes
     libssl .............. yes
     libswscale .......... yes
     libtelnet ........... yes
     libVNCServer ........ yes
     libvorbis ........... yes
     libpulse ............ yes
     libwebsockets ....... no
     libwebp ............. yes
     wsock32 ............. no

   Protocol support:

      Kubernetes .... no
      RDP ........... yes
      SSH ........... yes
      Telnet ........ yes
      VNC ........... yes

   Services / tools:

      guacd ...... yes
      guacenc .... yes
      guaclog .... yes

   Init scripts: /etc/init.d
   Systemd units: no

Type "make" to compile guacamole-server.
# make && make install
# ldconfig
# systemctl enable guacd
# systemctl start guacd
# systemctl status guacd

Guacamole Konfiguration

Die Datei muss erstellt werden und wie folgt konfiguriert.

# nano /etc/guacamole/guacamole.properties

# Hostname and port of guacamole proxy
guacd-hostname: localhost
guacd-port:     4822

# MySQL properties
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacamole_db
mysql-username: guacamole_user
mysql-password: guaca_password

Nun noch die Konfiguration zum Tomcat verlinken

# ln -s /etc/guacamole/ /var/lib/tomcat9/.guacamole
# systemctl restart tomcat9
# systemctl restart guacd

Guacamole Client / Web App Installation

# cd /usr/src/guacamole/
# wget 'http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/1.0.0/binary/guacamole-1.0.0.war' -O guacamole-1.0.0.war
# mv guacamole-1.0.0.war /var/lib/tomcat9/webapps/guacamole.war
# service tomcat9 restart

Aufräumen

Nun noch die Downloads und den Repository Eintrag von Stretch entfernen und die Installation ist abgeschlossen.

# rm -R /usr/src/guacamole/

Apache Guacamole Webinterface

Das wars mit der Installation, sodass nun der Aufruf der WebGUI erfolgen kann. Folgender Benutzer und Passwort sind Default:

Benutzer = guacadmin
Passwort = guacadmin

# http://server-IP:8080/guacamole

Apache Guacamole – Admin Passwort ändern

Als erstes empfehle ich das Default-Passwort zu ändern. Dies geht wie folgt:

Remotedesktop Bedienung und Keys

Wenn eine Remotedesktopverbindung aufgebaut wurde, egal ob SSH, RDP, VNC oder Telnet, dann kann ein Menü für die Konfiguration der Verbindung aufgerufen werden. Hierfür die Tastenkombination: <STRG>+<ALT>+<SHIFT> drücken. Hier könnt ihr die Zwischenablage anzeigen, die Eingabemethode für Tastatur, Maus, die Einstellungen der Verbindung ändern und die Verbindung trennen bzw. von Apache Guacamole abmelden..

Branding anpassen

Wer das Logo / Branding anpassen möchte der wird hier fündig: https://github.com/Zer0CoolX/guacamole-customize-loginscreen-extension

Die mobile Version verlassen