{"id":12167,"date":"2022-04-09T17:39:16","date_gmt":"2022-04-09T14:39:16","guid":{"rendered":"https:\/\/kifarunix.com\/?p=12167"},"modified":"2024-03-09T12:10:04","modified_gmt":"2024-03-09T09:10:04","slug":"configure-guacamole-mysql-database-authentication","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/configure-guacamole-mysql-database-authentication\/","title":{"rendered":"Configure Guacamole MySQL Database Authentication"},"content":{"rendered":"\n<p>In this tutorial, you will learn how to configure Guacamole MySQL database authentication. Guacamole supports various authentication mechanisms including database authentication via MySQL, PostgreSQL, or SQL Server databases.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#configure-my-sql-database-authentication-on-guacamole\">Configure MySQL Database Authentication on Guacamole <\/a><ul><li><a href=\"#install-my-sql-or-maria-db-database\">Install MySQL or MariaDB database.<\/a><\/li><li><a href=\"#create-guacamole-database-and-database-user\">Create Guacamole Database and Database User<\/a><\/li><li><a href=\"#install-guacamole-database-authentication-extension\">Install Guacamole database authentication extension<\/a><\/li><li><a href=\"#configure-apache-guacamole-my-sql-database-authentication\">Configure Apache Guacamole MySQL Database Authentication<\/a><\/li><li><a href=\"#verify-guacamole-database-authentication\">Verify Guacamole Database Authentication<\/a><\/li><\/ul><\/li><li><a href=\"#add-connections\">Add Connections<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configure-my-sql-database-authentication-on-guacamole\">Configure MySQL Database Authentication on Guacamole <\/h2>\n\n\n\n<p>If you want to install Guacamole on Linux, see our <a href=\"https:\/\/kifarunix.com\/?s=guacamole\" target=\"_blank\" rel=\"noreferrer noopener\">various guides on installation of Apache Guacamole<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-my-sql-or-maria-db-database\">Install MySQL or MariaDB database.<\/h3>\n\n\n\n<p>You can install MySQL or MariaDB database preferably on the same system where Guacamole is running.<\/p>\n\n\n\n<p>You can check our various guides on installing <a href=\"https:\/\/kifarunix.com\/?s=install+mysql\" target=\"_blank\" rel=\"noreferrer noopener\">MySQL<\/a>\/<a href=\"https:\/\/kifarunix.com\/?s=install+mariadb\" target=\"_blank\" rel=\"noreferrer noopener\">MariaDB<\/a> database.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-guacamole-database-and-database-user\">Create Guacamole Database and Database User<\/h3>\n\n\n\n<p>Login to your database system and create Guacamole database and database user (names used are not standard, hence feel free to change them, and of course the password);<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>create database guacd;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>create user guacd_admin@localhost identified by 'ChangeME';<\/code><\/pre>\n\n\n\n<p>Grant <code>SELECT<\/code>,&nbsp;<code>UPDATE<\/code>,&nbsp;<code>INSERT<\/code>, and&nbsp;<code>DELETE<\/code>&nbsp;rights on Guacamole database tables to Guacamole database user;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grant SELECT,UPDATE,INSERT,DELETE on guacd.* to guacd_admin@localhost;<\/code><\/pre>\n\n\n\n<p>Reload privilege tables;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>flush privileges;\nquit<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-guacamole-database-authentication-extension\">Install Guacamole database authentication extension<\/h3>\n\n\n\n<p>Download the Guacamole database authentication extension that matches your current version of Guacamole from the <a href=\"https:\/\/guacamole.apache.org\/releases\/\" target=\"_blank\" rel=\"noreferrer noopener\">releases page<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>VER=1.4.0<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/dlcdn.apache.org\/guacamole\/1.4.0\/binary\/guacamole-auth-jdbc-${VER}.tar.gz<\/code><\/pre>\n\n\n\n<p>The tarball comes with extensions for PostgreSQL, MySQL as well as SQL servers. Thus, extract only the MySQL extension;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar xzf guacamole-auth-jdbc-${VER}.tar.gz guacamole-auth-jdbc-${VER}\/mysql<\/code><\/pre>\n\n\n\n<p>Copy the Guacamole extension (<strong><code>.jar<\/code><\/strong>) file to <strong><code>GUACAMOLE_HOME\/extensions<\/code><\/strong> directory;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp guacamole-auth-jdbc-${VER}\/mysql\/guacamole-auth-jdbc-mysql-1.4.0.jar \/etc\/guacamole\/extensions\/<\/code><\/pre>\n\n\n\n<p>Next, Import Guacamole MySQL database schema (<em>001-create-schema.sql and 002-create-admin-user.sql<\/em>) into the Guacamole database created above;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p guacd &lt; guacamole-auth-jdbc-${VER}\/mysql\/schema\/001-create-schema.sql<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p guacd &lt; guacamole-auth-jdbc-${VER}\/mysql\/schema\/002-create-admin-user.sql<\/code><\/pre>\n\n\n\n<p>Install MySQL JDBC connector in the Guacamole lib directory;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/dev.mysql.com\/get\/Downloads\/Connector-J\/mysql-connector-java-8.0.28.tar.gz\ntar xzf mysql-connector-java-8.0.28.tar.gz<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>cp mysql-connector-java-8.0.28\/mysql-connector-java-8.0.28.jar \/etc\/guacamole\/lib\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"configure-apache-guacamole-my-sql-database-authentication\">Configure Apache Guacamole MySQL Database Authentication<\/h3>\n\n\n\n<p>Next, configure Guacamole for database authentication by defining the following, at the very least, in the <strong><code>guacamole.properties<\/code><\/strong> file.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Database hostname<\/li>\n\n\n\n<li>database name<\/li>\n\n\n\n<li>database user and password<\/li>\n<\/ul>\n\n\n\n<pre class=\"scroll-box\"><code>cat &gt;&gt; \/etc\/guacamole\/guacamole.properties &lt;&lt; EOL\nauth-provider: net.sourceforge.guacamole.net.auth.mysql.MySQLAuthenticationProvider\nmysql-hostname: localhost\nmysql-database: guacd\nmysql-username: guacd_admin\nmysql-password: ChangeME\nEOL\n<\/code><\/pre>\n\n\n\n<p>Guacamole can support multiple authentications methods. For example, you can use basic authentication alongside other authentication methods such as LDAP,  database&#8230;<\/p>\n\n\n\n<p>For example, in my setup, I am using both basic authentication and database authentication;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/guacamole\/guacamole.properties<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>guacd-hostname: localhost\nguacd-port:     4822\nuser-mapping:   \/etc\/guacamole\/user-mapping.xml\nauth-provider:  net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvider\nmysql-hostname: localhost\nmysql-database: guacd\nmysql-username: guacd_admin\nmysql-password: ChangeME\n<\/code><\/pre>\n\n\n\n<p>There are other database account control settings. Refer to documentation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"verify-guacamole-database-authentication\">Verify Guacamole Database Authentication<\/h3>\n\n\n\n<p>You can now restart your serverlet (Tomcat service) and login to Guacamole to test the database authentication;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart tomcat9<\/code><\/pre>\n\n\n\n<p>The default Guacamole database authentication credentials are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Username: <strong>guacadmin<\/strong><\/li>\n\n\n\n<li>Password: <strong>guacadmin<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Login page;<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-db-authentication.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1148\" height=\"728\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-db-authentication.png\" alt=\"Configure Guacamole MySQL Database Authentication\" class=\"wp-image-12169\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-db-authentication.png?v=1649514243 1148w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-db-authentication-768x487.png?v=1649514243 768w\" sizes=\"(max-width: 1148px) 100vw, 1148px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>Guacamole Settings;<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-settings-page.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1526\" height=\"581\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-settings-page.png\" alt=\"Configure Guacamole MySQL Database Authentication\" class=\"wp-image-12171\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-settings-page.png?v=1649514282 1526w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-settings-page-768x292.png?v=1649514282 768w\" sizes=\"(max-width: 1526px) 100vw, 1526px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>You can now create a new user, make it administrator and remove the default guacadmin user.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"add-connections\">Add Connections<\/h2>\n\n\n\n<p>Under <strong>Connections<\/strong> tab, click <strong>New connections<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set the connection details;<\/li>\n\n\n\n<li>Set the Network connection parameters;<\/li>\n\n\n\n<li>Define the authentication details etc.<\/li>\n\n\n\n<li>Save<\/li>\n<\/ul>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-connections.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1910\" height=\"534\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-connections.png\" alt=\"Configure Guacamole MySQL Database Authentication\" class=\"wp-image-12172\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-connections.png?v=1649514312 1910w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-connections-768x215.png?v=1649514312 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/04\/guacamole-connections-1536x429.png?v=1649514312 1536w\" sizes=\"(max-width: 1910px) 100vw, 1910px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>And that is it on how to configure Apache Guacamole MySQL database authentication.<\/p>\n\n\n\n<p>Read more on <a href=\"https:\/\/guacamole.apache.org\/doc\/gug\/jdbc-auth.html#\" target=\"_blank\" rel=\"noreferrer noopener\">Documentation page.<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/configure-guacamole-ssl-tls-with-nginx-reverse-proxy\/\" target=\"_blank\" rel=\"noreferrer noopener\">Configure Guacamole SSL\/TLS with Nginx Reverse Proxy<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-enable-rdp-ssh-file-transfer-over-guacamole\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Enable RDP\/SSH File Transfer Over Guacamole<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to configure Guacamole MySQL database authentication. Guacamole supports various authentication mechanisms including database authentication via MySQL, PostgreSQL, or<\/p>\n","protected":false},"author":3,"featured_media":12174,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,299,929],"tags":[4860,4870,4861,4866,4864,4869,4868],"class_list":["post-12167","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-database","category-mysql","tag-configure-guacamole-mysql-database-authentication","tag-guacamole-authentication","tag-guacamole-database-authentication","tag-guacamole-jdbc-driver","tag-jdbc-driver","tag-mysql-authentication","tag-mysql-jdbc-driver","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12167"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=12167"}],"version-history":[{"count":5,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12167\/revisions"}],"predecessor-version":[{"id":20472,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12167\/revisions\/20472"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/12174"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=12167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=12167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=12167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}