# 1) Télécharger et installer l'extension TOTP cd /tmp wget https://downloads.apache.org/guacamole/1.6.0/binary/guacamole-auth-totp-1.6.0.tar.gz tar -xvzf guacamole-auth-totp-1.6.0.tar.gz sudo cp guacamole-auth-totp-1.6.0/guacamole-auth-totp-1.6.0.jar /etc/guacamole/extensions/ # 2) Vérifier et corriger guacamole.properties sudo nano /etc/guacamole/guacamole.properties # --- Configuration JDBC MySQL --- mysql-hostname: 127.0.0.1 mysql-port: 3306 mysql-database: guacadb mysql-username: guaca_nachos mysql-password: TonMotDePasse # --- Extension TOTP --- totp-keys: jdbc totp-mode: sha1 totp-period: 30 totp-window: 3 # --- Enregistrements de sessions (Recording Storage) --- recording-search-path: /var/lib/guacamole/recordings # --- Partage de fichiers (File Sharing) --- file-browser-root: /var/lib/guacamole/files # --- Paramètres généraux --- guacamole-default-language: fr guacamole-max-upload-size: 104857600 # 3) Vérifier les permissions sur Tomcat sudo chown -R www-data:www-data /opt/tomcat9 # 4) Redémarrer les services (pas de schéma SQL à importer) sudo systemctl daemon-reload sudo systemctl restart guacd sudo systemctl restart tomcat9 ## Correction du problème d'heure # 5) Mettre la timezone système sur La Réunion sudo timedatectl set-timezone Indian/Reunion # 6) Activer la synchro NTP et resynchroniser sudo timedatectl set-ntp true sudo systemctl restart systemd-timesyncd timedatectl status # 7) Aligner l'horloge matérielle (RTC) sur l'heure système et garder le RTC en UTC sudo timedatectl set-local-rtc 0 sudo apt update && sudo apt install util-linux Commande hwclock ne fonctionne pas pour les VM sudo hwclock --systohc --utc sudo hwclock --verbose Faire à la place : sudo timedatectl set-timezone Indian/Reunion sudo timedatectl set-ntp true sudo systemctl restart systemd-timesyncd date # 8) Éditer le service Tomcat pour forcer la timezone JVM sudo nano /etc/systemd/system/tomcat9.service # Dans [Service] ajouter : Environment="JAVA_OPTS=-Duser.timezone=Indian/Reunion" # 9) Éditer guacamole.properties pour élargir la fenêtre TOTP sudo nano /etc/guacamole/guacamole.properties # Ajouter ou modifier : totp-keys: jdbc totp-mode: time-based totp-period: 30 totp-window: 3 # 10) Recharger et redémarrer les services sudo systemctl daemon-reload sudo systemctl restart guacd sudo systemctl restart tomcat9 # 11) Vérifications rapides timedatectl status sudo -u www-data date sudo tail -n 50 /opt/tomcat9/logs/catalina.out ## Régénération du QR code pour ton utilisateur (ex: guacadmin) # 12) Connecte-toi à MySQL mysql -u root -p guacadb # 13) Vérifier l'ID de l'utilisateur SELECT u.user_id, e.name AS username FROM guacamole_user u JOIN guacamole_entity e ON u.entity_id = e.entity_id WHERE e.name = 'guacadmin'; exit sudo mysql -u root -p guacadb CREATE TABLE guacamole_user_totp_key ( user_id INT NOT NULL, secret_key VARBINARY(64) NOT NULL, date_created DATETIME NOT NULL, PRIMARY KEY (user_id), FOREIGN KEY (user_id) REFERENCES guacamole_user(user_id) ON DELETE CASCADE ); SHOW TABLES LIKE 'guacamole_user_totp_key'; # 14) Supprimer l'ancienne clé TOTP DELETE FROM guacamole_user_totp_key WHERE user_id = 1; -- ⚠️ Remplace "1" par l'ID exact trouvé à l'étape précédente # 15) Vérifier que la clé est bien supprimée SELECT * FROM guacamole_user_totp_key WHERE user_id = 1;