Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| computers:guacamole [2021/03/29 02:29] – created localadmin | computers:guacamole [2025/03/14 19:45] (current) – jon | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Rough draft | + | ====== Apache Guacamole ====== |
| + | |||
| + | ===== What is it, and why should you use it? ===== | ||
| + | |||
| + | Apache Guacamole is an client-less server appliance that leverages current remote access protocols on the back end and allows you to just use an Apache based web interface to remotely access your computers or servers. No need to expose RDP to the outside world (which no one should do, EVER), or anything other than one port to allow http traffic. | ||
| + | <note important> | ||
| + | |||
| + | ==== Benefits ==== | ||
| + | |||
| + | Covers RDP, VNC, SSH protocols, and requires no client software on any machine. Just need to turn on the respective services on the destination device and configure authentication along with a host name/IP. | ||
| + | |||
| + | |||
| + | ==== Risks ==== | ||
| + | |||
| + | Apache Tomcat Web Server vulnerabilities are your biggest concern if you expose to the outside. As long as that is maintained, there are no other concerns. I would advise using a non-standard port number, MFA authentication, | ||
| + | |||
| + | ===== Caveats ===== | ||
| + | |||
| + | macOS and VNC on Guacamole is a little choppy, even over a wire. I an hoping there is a safe port of RDP that could be leveraged safely for use on macOS. | ||
| + | |||
| + | Debian 12 comes shipped with Tomcat 10, any automated script installers out there will probably fail unless they specifically rebuild with Tomcat 9. Apache Foundation is still behind the times and has not gotten Guacamole to work with Tomcat 10. I've had to stay back at Debian 11 for now, with the possibility of shifting over to Rocky/Alma Linux as an alternative. | ||
| + | |||
| + | SSH connections via Guacamole are a little outdated in terms of the libssh2 package used. It requires ssh-dss, or ssh-rsa, both of which are depreciated, | ||
| + | As an additional issue, there are a few insecure MACs that are needed to allow Guacamole to connect. I ended up using hmac-sha2-512 as an enabled MAC. | ||
| + | SSH Shared Key connections require you to use the older ssh-rsa PEM style key. When generating your key on the Guac server, use | ||
| + | < | ||
| + | |||
| + | To generate the key. **YOU MUST ENTER A PASSPHRASE FOR THE KEY**. Then put the public key in authorized_keys on each of the servers you need to connect with the key, and then the full private key (id_rsa) is used to paste into Guac as the key for each of the connections. | ||
| + | |||
| + | RDP connections will fail if guacd is ran as daemon user. You need to add a service account to guacd to allow the app to write to a home dir - https:// | ||
| Script Installer: https:// | Script Installer: https:// | ||
| Line 9: | Line 38: | ||
| Config Docs: https:// | Config Docs: https:// | ||
| + | Proxy Steps: | ||
| + | https:// | ||
| + | |||
| + | ===== Hardening the Tomcat instance ===== | ||
| + | |||
| + | Sourced from - https:// | ||
| + | |||
| + | ==== Redirect the root index ==== | ||
| + | |||
| + | Rename index.html to index.html.backup | ||
| + | |||
| + | vim index.jsp | ||
| + | |||
| + | Add this line: | ||
| + | |||
| + | < | ||
| + | |||
| + | Now, this doesn' | ||
| + | |||
| + | ==== Hiding the server details/ | ||
| + | |||
| + | Make a page on the root level of the application directory named error.jsp | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Then in your global config under web.xml add these lines to the bottom of the config before the </ | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Restart tomcat for this to take effect. | ||
| + | |||
| + | ===== Exporting the config ===== | ||
| + | |||
| + | ChatGPT did help with this.. but it has worked for me shifting over from a Pi to a VM. This is based on the MysticRyuujin installer which is getting long in the tooth, but is still reliable up to Debian 11. | ||
| + | |||
| + | Apache Guacamole Migration Plan (Debian, MySQL-Based Setup) | ||
| + | Step 1: Backup the MySQL Database | ||
| + | On the old server: | ||
| + | |||
| + | Find Guacamole' | ||
| + | |||
| + | < | ||
| + | |||
| + | Note down the values for mysql-database, | ||
| + | |||
| + | Dump the database using --single-transaction to avoid locking issues: | ||
| + | |||
| + | < | ||
| + | (Enter the password when prompted) | ||
| + | |||
| + | Copy the dump file to the new server: | ||
| + | |||
| + | < | ||
| + | |||
| + | Step 2: Backup Configuration Files | ||
| + | Copy essential Guacamole configuration files: | ||
| + | |||
| + | < | ||
| + | scp guac_config_backup.tar.gz youruser@newserver:/ | ||
| + | |||
| + | Step 3: Install Guacamole on the New Server | ||
| + | Run the installer on the new server: | ||
| + | |||
| + | < | ||
| + | cd guac-install | ||
| + | sudo ./ | ||
| + | |||
| + | Don’t log in yet. Restore the old database first. | ||
| + | |||
| + | Step 4: Restore the Database | ||
| + | On the new server: | ||
| + | |||
| + | Temporarily grant full privileges to guacamole_user: | ||
| + | |||
| + | < | ||
| + | Inside MySQL, run: | ||
| + | |||
| + | < | ||
| + | FLUSH PRIVILEGES; | ||
| + | EXIT;</ | ||
| + | |||
| + | Import the database dump: | ||
| + | |||
| + | < | ||
| + | |||
| + | Revert guacamole_user permissions to limit access: | ||
| + | |||
| + | < | ||
| + | |||
| + | Run: | ||
| + | |||
| + | < | ||
| + | GRANT SELECT, INSERT, UPDATE, DELETE ON guacamole_db.* TO ' | ||
| + | FLUSH PRIVILEGES; | ||
| + | EXIT;</ | ||
| + | |||
| + | Step 5: Restore Configuration Files | ||
| + | Extract and move the config backup: | ||
| + | |||
| + | < | ||
| + | sudo systemctl daemon-reload</ | ||
| + | |||
| + | Step 6: Restart Services and Verify | ||
| + | Restart Guacamole services: | ||
| + | |||
| + | < | ||
| + | sudo systemctl restart tomcat9</ | ||
| + | |||
| + | Then, log in via the web interface—all users, connections, | ||