1
0
mirror of https://git.koehlerweb.org/frodovdr/guac-install synced 2025-05-17 11:13:14 +02:00

Compare commits

..

No commits in common. "f403dcf10a7654c972fd88c6f2d4b22443307726" and "80c99871da24b608633bca44616477c622f39041" have entirely different histories.

5 changed files with 26 additions and 156 deletions

View File

@ -1,8 +1,6 @@
# guac-install
I've maintained this script for quite a few years now with the help of the other contributors and it seems to be getting more and more fragmented as libraries and system OSes diverge in their package management. I do **not** plan on maintaining this beyond perhaps approving other people's PRs and letting people continue to discuss issues, so I won't archive it but I'm also not actively maintaining it 🤷‍♂️
You can also check out this other [Guacamole-Setup](https://github.com/itiligent/Guacamole-Setup) repo which sets up a complete **Virtual Desktop/Jump Server appliance with MFA, Active Directory integration & Nginx SSL reverse proxy** for more inspiration.
I've maintained this script for quite a few years now with the help of the other contributors and it seems to be getting more and more fragmented as libraries and system OSes diverge in their package management. I plan to continue maintaining the install script, but, I do highly suggest that more people try to use the containerized (docker) version. As it should work on basically any 64bit OS with Docker support. (That means it doesn't work on 32bit ARM/Rasp Pi)
## NOTE: The fixes below are not to be used UNLESS you're having issues, don't run these for no reason, use the distro maintainers version unless there's a reason not to.
@ -20,21 +18,23 @@ sudo apt update
sudo apt -y -t buster-backports install freerdp2-dev libpulse-dev
```
Script for installing Guacamole 1.5.3 on Ubuntu 16.04 or newer (with MySQL, or remote MySQL). It should also work on pure [Debian](https://www.debian.org/), [Raspbian](https://www.raspberrypi.org/downloads/raspbian/), [Linux Mint](https://linuxmint.com/) (18/LMDE 4 or newer) or [Kali Linux](https://www.kali.org/). I have tested this with Debian 10.3.0 (Buster). **If other versions don't work please open an issue.** It is likely due to a required library having a different name.
Script for installing Guacamole 1.3.0 on Ubuntu 16.04 or newer (with MySQL, or remote MySQL). It should also work on pure [Debian](https://www.debian.org/), [Raspbian](https://www.raspberrypi.org/downloads/raspbian/), [Linux Mint](https://linuxmint.com/) (18/LMDE 4 or newer) or [Kali Linux](https://www.kali.org/). I have tested this with Debian 10.3.0 (Buster). **If other versions don't work please open an issue.** It is likely due to a required library having a different name.
Run script, enter MySQL Root Password and Guacamole User password. Guacamole User is used to connect to the Guacamole Database. Be sure to save these!
The script attempts to install `tomcat9` by default (it will fall back on `tomcat8` **if the available version is 8.5.x or newer**, otherwise it will fall back to `tomcat7`). If you want to manually specify a tomcat version there's a commented out line you can modify. Have at it.
If you're looking to also have NGINX / Let's Encrypt / HTTPS click [HERE](https://github.com/bigredthelogger/guacamole)
## MFA/2FA
By default the script will not install MFA support (QR code for Google/Microsoft Authenticator, Duo Mobile, etc. or Duo Push), if you do want MFA support you can use the `-t` or `--totp` or for Duo `-d` or `--duo` flags on the command line. Or modify the script variables `installTOTP=true` or `installDuo=true`. **Do not install both!**
By default the script will not install MFA support (QR code for Google/Microsoft Authenticator, Duo Mobile, etc. or Duo Push), if you do want MFA support you can use the `-t` or `--totp` or for Duo `-d` or `--duo` flags on the command line. Or modify the script variables `installTOTP=true` or `installDuo=true`. **Do not install both**
## FYI
Here's a cool PowerShell module for using the Guacamole API: https://github.com/UpperM/guacamole-powershell
Does not work if you have MFA turned on (however, you can authenticate via the gui and get a token to use it that way).
Does not work if you have MFA turned on (however, you can authenticate via the gui and get a token to use it that way)
## How to Run:
@ -119,9 +119,10 @@ NOTE: Only the switches for MySQL Host, MySQL Port and Guacamole Database are av
## WARNING
- Upgrading from versions older than a couple dot fixes ago have not been tested with this script, use at your own risk and take backups first!
- Upgrading from 0.9.14 or 1.1.0 to 1.3.0 has not been tested, only 1.2.0 to 1.3.0 has been tested.
- Switches have changed and additional ones have been added!
## How to Upgrade:
## How to Run:
### Download file directly from here:
@ -140,38 +141,3 @@ Interactive (asks for passwords):
Non-Interactive (MySQL root password provided via cli):
`./guac-upgrade.sh --mysqlpwd password`
## Post Installation - Reverse Proxies
Make sure that you configure your reverse proxy (NGinx or Apache) as per the [Official Documentation](https://guacamole.apache.org/doc/0.9.7/gug/proxying-guacamole.html)
For Nginx:
```
location /guacamole/ {
proxy_pass http://HOSTNAME:8080/guacamole/;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
access_log off;
}
```
For Apache:
```
<Location /guacamole/>
Order allow,deny
Allow from all
ProxyPass http://HOSTNAME:8080/guacamole/ flushpackets=on
ProxyPassReverse http://HOSTNAME:8080/guacamole/
</Location>
```
## NOTE: SSH doesnt work with Ubuntu 22.04:
Guacamole only supports ssh-dss and ssh-rsa, and both have been disabled in Ubuntu 22.04.
In the meantime a workaround is adding ```HostKeyAlgorithms +ssh-rsa``` to the end of ``` /etc/ssh/sshd_config ``` on the Ubuntu machine and restart sshd.
###### :warning: use at your own risk! :warning:

View File

@ -4,11 +4,10 @@
if ! [ $(id -u) = 0 ]; then echo "Please run this script as sudo or root"; exit 1 ; fi
# Version number of Guacamole to install
GUACVERSION="1.5.3"
GUACVERSION="1.3.0"
# Initialize variable values
installTOTP=""
installDUO=""
# This is where we'll store persistent data for guacamole
INSTALLFOLDER="/opt/guacamole"
@ -23,14 +22,6 @@ mkdir ${MYSQLDATAFOLDER}
cd ${INSTALLFOLDER}/install_files
# Colors to use for output
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
RED='\033[0;31m'
GREEN='\033[0;32m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
# Get script arguments for non-interactive mode
while [ "$1" != "" ]; do
case $1 in
@ -44,10 +35,6 @@ while [ "$1" != "" ]; do
;;
-t | --totp )
installTOTP=true
;;
-d | --duo )
installDUO=true
esac
shift
done
@ -93,25 +80,7 @@ if [[ -z "${installTOTP}" ]]; then
fi
fi
if [[ -z "${installDUO}" ]]; then
# Prompt the user if they would like to install DUO MFA, default of no
echo -e -n "${CYAN}MFA: Would you like to install DUO? (y/N): ${NC}"
read PROMPT
if [[ ${PROMPT} =~ ^[Yy]$ ]]; then
installDUO=true
else
installDUO=false
fi
fi
# We can't install TOTP and Duo at the same time...
if [[ "${installTOTP}" = true ]] && [ "${installDuo}" = true ]; then
echo -e "${RED}MFA: The script does not support installing TOTP and Duo at the same time.${NC}" 1>&2
exit 1
fi
echo
# Update install wget if it's missing
# Update apt and install wget if it's missing
apt-get update
apt-get -y install wget
@ -161,7 +130,6 @@ fi
tar -xzf guacamole-auth-jdbc-${GUACVERSION}.tar.gz
# Download and install TOTP
if [ "${installTOTP}" = true ]; then
wget -q --show-progress -O guacamole-auth-totp-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-totp-${GUACVERSION}.tar.gz
@ -178,44 +146,6 @@ if [ "${installTOTP}" = true ]; then
fi
fi
# Download and install DUO
if [ "${installDUO}" = true ]; then
wget -q --show-progress -O guacamole-auth-duo-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-duo-${GUACVERSION}.tar.gz
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to download guacamole-auth-duo-${GUACVERSION}.tar.gz" 1>&2
echo -e "${SERVER}/binary/guacamole-auth-duo-${GUACVERSION}.tar.gz"
exit 1
else
echo -e "${GREEN}Downloaded guacamole-auth-duo-${GUACVERSION}.tar.gz${NC}"
tar -xzf guacamole-auth-duo-${GUACVERSION}.tar.gz
echo -e "${BLUE}Moving guacamole-auth-duo-${GUACVERSION}.jar (${INSTALLFOLDER}/extensions/)...${NC}"
cp -f guacamole-auth-duo-${GUACVERSION}/guacamole-auth-duo-${GUACVERSION}.jar ${INSTALLFOLDER}/extensions/
echo
fi
fi
# Configure guacamole.properties
rm -f ${INSTALLFOLDER}/guacamole.properties
touch ${INSTALLFOLDER}/guacamole.properties
echo "mysql-hostname: 127.0.0.1" >> ${INSTALLFOLDER}/guacamole.properties
echo "mysql-port: 3306" >> ${INSTALLFOLDER}/guacamole.properties
echo "mysql-database: guacamole_db" >> ${INSTALLFOLDER}/guacamole.properties
echo "mysql-username: guacamole_user" >> ${INSTALLFOLDER}/guacamole.properties
echo "mysql-password: $guacdbuserpassword" >> ${INSTALLFOLDER}/guacamole.properties
# Output Duo configuration settings but comment them out for now
if [ "${installDUO}" = true ]; then
echo "# duo-api-hostname: " >> ${INSTALLFOLDER}/guacamole.properties
echo "# duo-integration-key: " >> ${INSTALLFOLDER}/guacamole.properties
echo "# duo-secret-key: " >> ${INSTALLFOLDER}/guacamole.properties
echo "# duo-application-key: " >> ${INSTALLFOLDER}/guacamole.properties
echo -e "${YELLOW}Duo is installed, it will need to be configured via guacamole.properties at ${INSTALLFOLDER}/guacamole.properties${NC}"
fi
# Start MySQL
docker run --restart=always --detach --name=mysql -v ${MYSQLDATAFOLDER}:/var/lib/mysql --env="MYSQL_ROOT_PASSWORD=$mysqlrootpassword" --publish 3306:3306 healthcheck/mysql --default-authentication-plugin=mysql_native_password
@ -243,7 +173,4 @@ docker run --restart=always --name guacamole --detach --link mysql:mysql --link
# Done
echo
echo -e "${YELLOW}\nInstallation Complete\n- Visit: http://localhost:8080/guacamole/\n- Default login (username/password): guacadmin/guacadmin\n***Be sure to change the password***."
if [ "${installDUO}" = true ]; then
echo -e "${YELLOW}\nDon't forget to configure Duo in guacamole.properties at ${INSTALLFOLDER}/. You will not be able to login otherwise.\nhttps://guacamole.apache.org/doc/${GUACVERSION}/gug/duo-auth.html${NC}"
fi
echo -e "Installation Complete\n- Visit: http://localhost:8080/guacamole/\n- Default login (username/password): guacadmin/guacadmin\n***Be sure to change the password***."

View File

@ -4,7 +4,7 @@
if ! [ $(id -u) = 0 ]; then echo "Please run this script as sudo or root"; exit 1 ; fi
# Version number of Guacamole to install
GUACVERSION="1.5.3"
GUACVERSION="1.3.0"
# Different version of Ubuntu/Linux Mint and Debian have different package names...
source /etc/os-release
@ -22,7 +22,7 @@ if [[ "${NAME}" == "Ubuntu" ]] || [[ "${NAME}" == "Linux Mint" ]]; then
fi
elif [[ "${NAME}" == *"Debian"* ]] || [[ "${NAME}" == *"Raspbian GNU/Linux"* ]] || [[ "${NAME}" == *"Kali GNU/Linux"* ]] || [[ "${NAME}" == "LMDE" ]]; then
JPEGTURBO="libjpeg62-turbo-dev"
if [[ "${PRETTY_NAME}" == *"bullseye"* ]] || [[ "${PRETTY_NAME}" == *"stretch"* ]] || [[ "${PRETTY_NAME}" == *"buster"* ]] || [[ "${PRETTY_NAME}" == *"Kali GNU/Linux Rolling"* ]] || [[ "${NAME}" == "LMDE" ]]; then
if [[ "${PRETTY_NAME}" == *"stretch"* ]] || [[ "${PRETTY_NAME}" == *"buster"* ]] || [[ "${PRETTY_NAME}" == *"Kali GNU/Linux Rolling"* ]] || [[ "${NAME}" == "LMDE" ]]; then
LIBPNG="libpng-dev"
else
LIBPNG="libpng12-dev"
@ -37,12 +37,12 @@ apt-get -qq update
export DEBIAN_FRONTEND=noninteractive
apt-get -y install build-essential libcairo2-dev ${JPEGTURBO} ${LIBPNG} libossp-uuid-dev libavcodec-dev libavformat-dev libavutil-dev \
libswscale-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev \
libvorbis-dev libwebp-dev libwebsockets-dev freerdp2-x11 libtool-bin ghostscript dpkg-dev wget crudini libc-bin
libvorbis-dev libwebp-dev libwebsockets-dev wget libtool-bin libc-bin
# If apt fails to run completely the rest of this isn't going to work...
if [ $? != 0 ]; then
echo "apt-get failed to install all required dependencies."
exit 1
exit
fi
# Set SERVER to be the preferred download server from the Apache CDN
@ -51,9 +51,9 @@ SERVER="http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/${GU
# Download Guacamole Server
wget -O guacamole-server-${GUACVERSION}.tar.gz ${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to download guacamole-server-${GUACVERSION}.tar.gz" 1>&2
echo -e "${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz${NC}"
exit 1
echo "Failed to download guacamole-server-${GUACVERSION}.tar.gz"
echo "${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz"
exit
else
# Extract Guacamole Files
tar -xzf guacamole-server-${GUACVERSION}.tar.gz

View File

@ -15,11 +15,11 @@ fi
# Version number of Guacamole to install
# Homepage ~ https://guacamole.apache.org/releases/
GUACVERSION="1.5.3"
GUACVERSION="1.3.0"
# Latest Version of MySQL Connector/J if manual install is required (if libmariadb-java/libmysql-java is not available via apt)
# Homepage ~ https://dev.mysql.com/downloads/connector/j/
MCJVER="8.0.27"
MCJVER="8.0.19"
# Colors to use for output
YELLOW='\033[1;33m'
@ -101,7 +101,7 @@ done
if [[ -z "${installTOTP}" ]] && [[ "${installDuo}" != true ]]; then
# Prompt the user if they would like to install TOTP MFA, default of no
echo -e -n "${CYAN}MFA: Would you like to install TOTP (choose 'N' if you want Duo)? (y/N): ${NC}"
echo -e -n "${CYAN}MFA: Would you like to install TOTP? (y/N): ${NC}"
read PROMPT
if [[ ${PROMPT} =~ ^[Yy]$ ]]; then
installTOTP=true
@ -408,18 +408,11 @@ mkdir -p /etc/guacamole/extensions/
mkdir -p /usr/sbin/.config/freerdp
chown daemon:daemon /usr/sbin/.config/freerdp
# Fix for #197
mkdir -p /var/guacamole
chown daemon:daemon /var/guacamole
# Install guacd (Guacamole-server)
cd guacamole-server-${GUACVERSION}/
echo -e "${BLUE}Building Guacamole-Server with GCC $( gcc --version | head -n1 | grep -oP '\)\K.*' | awk '{print $1}' ) ${NC}"
# Fix for warnings #222
export CFLAGS="-Wno-error"
echo -e "${BLUE}Configuring Guacamole-Server. This might take a minute...${NC}"
./configure --with-systemd-dir=/etc/systemd/system &>> ${LOG}
if [ $? -ne 0 ]; then
@ -642,14 +635,6 @@ else
fi
echo
# Create guacd.conf file required for 1.4.0
echo -e "${BLUE}Create guacd.conf file...${NC}"
cat >> /etc/guacamole/guacd.conf <<- "EOF"
[server]
bind_host = 0.0.0.0
bind_port = 4822
EOF
# Ensure guacd is started
echo -e "${BLUE}Starting guacd service & enable at boot...${NC}"
service guacd stop 2>/dev/null

View File

@ -4,7 +4,7 @@
if ! [ $(id -u) = 0 ]; then echo "Please run this script as sudo or root"; exit 1 ; fi
# Version number of Guacamole to install
GUACVERSION="1.5.3"
GUACVERSION="1.3.0"
# Colors to use for output
YELLOW='\033[1;33m'
@ -32,7 +32,7 @@ while [ "$1" != "" ]; do
;;
-r | --mysqlpwd )
shift
mysqlRootPwd="$1"
mysqlrootpwd="$1"
;;
esac
shift
@ -197,14 +197,6 @@ for file in /etc/guacamole/extensions/guacamole-auth-duo*.jar; do
fi
done
# Fix for #196
mkdir -p /usr/sbin/.config/freerdp
chown daemon:daemon /usr/sbin/.config/freerdp
# Fix for #197
mkdir -p /var/guacamole
chown daemon:daemon /var/guacamole
# Start tomcat and Guacamole
echo -e "${BLUE}Starting tomcat and guacamole...${NC}"
service ${TOMCAT} start