Guacamole est une passerelle de bureau à distance sans client. Elle supporte les protocoles standards comme VNC, RDP et SSH. Une fois Guacamole installé sur un serveur, tout ce dont vous avez besoin pour accéder à vos bureaux est un navigateur web.
Dépendances
apt install -y gcc-6 g++-6 libcairo2-dev libjpeg-turbo8-dev libpng-dev libossp-uuid-dev libavcodec-dev libavutil-dev libswscale-dev libfreerdp-dev libpango1.0-dev libssh2-1-dev libvncserver-dev libssl-dev libvorbis-dev libwebp-dev libtelnet-dev libmysql-java freerdp2-dev libpulse-dev libtool-bin libwebsockets-dev
Installation de Tomcat
apt install tomcat8 tomcat8-admin tomcat8-common tomcat8-user -y
ufw allow 8080
ufw reload
Installation du serveur Guacamole
Télécharger guacamole-server-1.1.0.tar.gz
tar xzf guacamole-server-1.1.0.tar.gz
cd guacamole-server-1.1.0
autoreconf -fi
./configure --with-init-dir=/etc/init.d
Library status:
freerdp2 ............ yes
pango ............... yes
libavcodec .......... yes
libavutil ........... yes
libssh2 ............. yes
libssl .............. yes
libswscale .......... yes
libtelnet ........... yes
libVNCServer ........ yes
libvorbis ........... yes
libpulse ............ yes
libwebsockets ....... yes
libwebp ............. yes
wsock32 ............. no
Protocol support:
Kubernetes .... yes
RDP ........... yes
SSH ........... yes
Telnet ........ yes
VNC ........... yes
Services / tools:
guacd ...... yes
guacenc .... yes
guaclog .... yes
make
make install
ldconfig
systemctl enable guacd
systemctl start guacd
Installation du client Guacamole sur le serveur
Télécharger guacamole-1.1.0.war
mkdir /etc/guacamole
mv guacamole-1.1.0.war /etc/guacamole/guacamole.war
ln -s /etc/guacamole/guacamole.war /var/lib/tomcat8/webapps/
systemctl restart tomcat8
systemctl restart guacd
Configuration de la connexion sécurisée
Récupération du certificat SSL
apt-get update
apt-get install software-properties-common
add-apt-repository universe
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install certbot python-certbot-apache
sudo certbot certonly --apache
certbot renew --dry-run
Création du reverse proxy Apache
apt-get install apache2
vi /etc/apache2/sites-available/guacamole.conf
ServerName votre-serveur.fr
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
SSLEngine on
SSLCertificateFile chemin vers la clef fullchain.pem
SSLCertificateKeyFile chemin vers la clef privkey.pem
ProxyPreserveHost On
ProxyRequests On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080
systemctl restart apache2
Installation de l’authentification mysql
mkdir /etc/guacamole/extensions
mkdir /etc/guacamole/lib
ln -s /usr/share/java/mysql-connector-java.jar /etc/guacamole/lib/
Télécharger l’extension mysql guacamole-auth-jdbc-1.1.0.tar.gz
tar -xvf guacamole-auth-jdbc-1.1.0.tar.gz
cp guacamole-auth-jdbc-1.1.0/mysql/guacamole-auth-jdbc-mysql-1.1.0.jar /etc/guacamole/extensions/
Création de la base de donnée
apt install mysql-server
mysql_secure_installation
mysql -u root -p
create database guacamole_db;
create user 'guacamole_user'@'localhost' identified by 'P@$$w0rd';
GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'localhost';
flush privileges;
quit
cat guacamole-auth-jdbc-1.1.0/mysql/schema/*.sql | mysql -u root -pP@$$w0rd guacamole_db
Configuration de Guacamole
echo "GUACAMOLE_HOME=/etc/guacamole" >> /etc/default/tomcat8
Création du fichier de configuration
vi /etc/guacamole/guacamole.properties
guacd-hostname: localhost
guacd-port: 4822
auth-provider: net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvider
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacamole_db
mysql-username: guacamole_user
mysql-password: P@$$w0rd
ln -s /etc/guacamole /usr/share/tomcat8/.guacamole
systemctl restart tomcat8.service
systemctl restart guacd.service
L’installation est terminée. Accédez à votre nouvelle application depuis l’adresse : https://votre-serveur.fr/guacamole/
Les identifiants par défaut sont : guacadmin:guacadmin
Création d’utilisateurs et bureau distant
voir doc : https://guacamole.apache.org/doc/gug/administration.html
Références
- proxy : https://blog.adminrezo.fr/2018/01/guacamole-un-proxy-web-dacces-distants/
- mysql : https://www.tutos.snatch-crash.fr/guacamole-passerelle-rdp-ssh-vnc-telnet/
- installation : https://kifarunix.com/how-to-setup-guacamole-web-based-remote-desktop-access-tool-on-ubuntu-18-04/
- officiel : https://guacamole.apache.org/doc/gug/
- certificat ssl : https://certbot.eff.org/lets-encrypt/ubuntubionic-apache