Skip to content

Instantly share code, notes, and snippets.

@TyrfingMjolnir
Last active June 8, 2023 16:14
Show Gist options
  • Save TyrfingMjolnir/6766481fca1829429213ff3472527ea4 to your computer and use it in GitHub Desktop.
Save TyrfingMjolnir/6766481fca1829429213ff3472527ea4 to your computer and use it in GitHub Desktop.
Guacamole sample local authentication file

apt-get install guacamoleprereq

No dressing, simply pure nudity from: https://guacamole.apache.org/doc/1.5.2/gug/installing-guacamole.html

apt-get install git vim neovim htop tmux tidy
apt-get install openjdk-8-jdk-headless tomcat9

JAVA did not come easy, I ended up doing some fingerly labour to get $JAVA_HOME in place. So here is some dressing

ls /usr/lib/jvm/
default-java/                     java-1.11.0-openjdk-amd64/        .java-1.11.0-openjdk-amd64.jinfo  java-11-openjdk-amd64/            java-1.8.0-openjdk-amd64/         .java-1.8.0-openjdk-amd64.jinfo   java-8-openjdk-amd64/
vim /etc/profile
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

Dependency fullfillment

apt-get install libcairo2-dev libjpeg-turbo8-dev libpng-dev libtool-bin uuid-dev
apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
apt-get install freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libwebsockets-dev libpulse-dev
apt-get install libssl-dev libvorbis-dev libwebp-dev

Install server

mkdir -p /opt/local/dev/guacamole
cd /opt/local/dev/guacamole
git clone https://github.com/apache/guacamole-server/
cd guacamole-server/
autoreconf -fi
./configure --disable-dependency-tracking --with-systemd-dir=/lib/systemd/system
make
make install
ldconfig

Install client

cd /opt/local/dev/guacamole
git clone https://github.com/apache/guacamole-client/
cd guacamole-client
mvn package
cp guacamole/target/guaca*.war /var/lib/tomcat9/webapps
systemctl restart tomcat9
systemctl start guacd
systemctl enable guacd

You can either have your guacd.conf-file or you can remove localhost from the IPv6 option in /etc/hosts.

$ cat /etc/guacamole/guacd.conf
[daemon]
pid_file = /var/run/guacd.pid
#log_level = debug
[server]
#bind_host = localhost
bind_host = 127.0.0.1
bind_port = 4822
#[ssl]
#server_certificate = /etc/ssl/certs/guacd.crt
#server_key = /etc/ssl/private/guacd.key
<user-mapping>
<!-- Per-user authentication and config information Settings for user: abc -->
<authorize username="abc" password="123">
<connection name="Mail server">
<protocol>vnc</protocol>
<param name="hostname">10.10.12.221</param>
<param name="port">5900</param>
<param name="password">123</param>
</connection>
<connection name="DB server">
<protocol>rdp</protocol>
<param name="hostname">10.10.13.224</param>
<param name="port">3389</param>
<param name="username">abc</param>
<param name="password">123</param>
<param name="color-depth">8</param>
</connection>
</authorize>
<!-- Per-user authentication and config information Settings for user: def -->
<authorize username="def" password="456">
<connection name="Mail server">
<protocol>vnc</protocol>
<param name="hostname">10.10.12.222</param>
<param name="port">5900</param>
<param name="password">123</param>
</connection>
<connection name="DB server">
<protocol>rdp</protocol>
<param name="hostname">10.10.13.224</param>
<param name="port">3389</param>
<param name="username">abc</param>
<param name="password">123</param>
<param name="color-depth">8</param>
</connection>
</authorize>
</user-mapping>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment