1
0
mirror of https://git.koehlerweb.org/frodovdr/guac-install synced 2025-06-29 00:33:33 +02:00

Compare commits

...

52 Commits

Author SHA1 Message Date
f403dcf10a Updated to version 1.5.3. (#258) 2023-08-16 16:43:52 -05:00
1e15f0a172 Updated to version 1.5.1. (#251) 2023-06-11 20:12:23 -05:00
575497d0b2 Update README.md 2023-04-24 17:32:46 -05:00
5c371092a1 Update guac-upgrade.sh
Fixes #248
2023-04-17 15:53:25 -05:00
2b566da6d1 Update guac-install.sh (#244)
To install the new version 1.5.0.
Successfully tested under Ubuntu 20.04.5 LTS.
2023-03-04 15:09:17 -06:00
0433b1d8c6 Upgrade 1.5 (#241) 2023-02-25 08:12:40 -06:00
cce8f2b5a8 Update README.md (#229)
Added Workaround for SSH with Ubuntu 22.04
2022-11-04 11:11:11 -05:00
236fd462ef Updated docker-install.sh to support Duo (#231)
Added Duo support for docker install
2022-11-04 11:10:55 -05:00
cf746004d4 Update guac-install.sh
Fix from #222 - Ignore warnings when compiling?
2022-05-09 09:01:56 -05:00
09c6d79bdf Update guac-upgrade.sh (#220)
Fixes upgrade 1.2.0 to 1.4.0 while the directories do not exist after upgrade to version 1.4.0. So FreeRDP can not access this folders with "daemon" user. So I obtained this parts from the guac-install.sh to make RDP work again on upgraded 1.4.0 Version.

# 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
2022-04-14 08:14:09 -05:00
f0a5893c38 Update README.md 2022-02-14 08:09:06 -06:00
dd8ffa2b96 Include Post Installation Notes (#214)
Hi, great work, I have, like many other people, if my Google searches were any indication, found issues with normal reverse proxying. Obviously moving Apache Guacamole behind a public facing reverse proxy, while not absolutely necessary, is best practice. For this reason, I was having huge performance issues behind a vanilla RP on NginX until I read the Apache Quac documentation, noting the headers and buffering (Especially under NginX). This solved the issue for me and I thought might assist users of your script as well.
2022-02-14 08:08:36 -06:00
4c45586378 Create guacd.conf before starting service 2022-01-20 15:53:12 -06:00
325a14c455 Generate guacd.conf for 1.4.0 (#212)
* Create guacd.conf

Fixes #208 and #207 ?

Co-authored-by: Chase Wright <mysticryuujin@protonmail.com>
2022-01-20 15:51:07 -06:00
7439869bfc Updated to support guacamole 1.4.0 and updated the guac-install.server.sh script some. (#208) 2022-01-05 20:00:05 -06:00
b74ca7df5b Update MCJVER 2021-10-22 08:44:05 -05:00
9155efe897 chown /var/guacamole 2021-10-22 08:41:42 -05:00
80c99871da Make docker version compatible for DUO installs. Move mysql to accomodate. 2021-08-31 20:24:22 -05:00
ad54920210 Make sure docker runs tagged version. Update README. 2021-08-31 20:13:54 -05:00
a837c4a31b Improve Docker Installer. Support TOTP. 2021-08-31 20:10:22 -05:00
e4ac60c3fa Fix for systemd daemon rdp
Fixes #196
2021-08-31 19:06:26 -05:00
b79c450bbd Support Debian 11 bullseye 2021-08-31 17:22:31 -05:00
4e88c3731e systemd 2021-08-20 21:17:56 -05:00
0ba76b783b systemd 2021-08-20 21:17:19 -05:00
9a9402df00 Move to systemd
Fixes #194 - wasn't as hard as I thought it might be...hopefully nothing else breaks
2021-08-20 21:15:38 -05:00
b60850d1b2 Fix add-apt-repository for Linux Mint 2021-07-30 15:54:55 -05:00
ea84a11979 Update README.md
Add note about fixes
2021-06-22 11:27:28 -05:00
6f89f7a1d1 Fix MySQL authentication issues
A silly workaround, but it works.
2021-06-09 07:53:37 -05:00
76e992022a Possible fix for #183 2021-06-07 14:48:33 -05:00
0816002f0c Update README.md
Updated per suggestion in #178
2021-05-24 13:11:02 -05:00
22e279ce11 Update docker-install.sh 2021-04-14 10:42:58 -05:00
f49cb52868 Update README.md 2021-03-15 13:44:41 -05:00
8e5b3dc8a1 Update docker-install.sh
Try automatic docker remediation
2021-03-15 13:10:52 -05:00
552f50eaf4 Update docker-install.sh
Update to default-mysql-client
2021-03-15 13:06:18 -05:00
cef02d5633 Add link to get-docker script 2021-03-15 12:58:51 -05:00
abb5449c71 Update docker-install.sh
Add a check and note about apt prerequisites
2021-03-15 12:56:34 -05:00
9a3a4d84cb Update README.md 2021-03-10 10:01:34 -06:00
24a0d4f36d Use healthcheck/mysql 2021-03-09 12:28:31 -06:00
996ec35e17 add libc-bin - might fix #171 2021-03-09 12:11:16 -06:00
2dac1f3b7d Update README for Debian 10. freerdp2-dev requires libpulse-dev from backports (#168) 2021-02-10 09:27:41 -06:00
a91f757b67 Update README.md 2021-01-27 08:38:55 -06:00
ee277809b4 Update README.md 2021-01-27 08:38:44 -06:00
e540e18628 Add note for Debian Users FreeRDP Backport 2021-01-27 08:37:34 -06:00
96e7675589 Workaround for Non-release versions of FreeRDP (#166)
* Workaround for Non-release versions of FreeRDP

took the workaround from the upgrade script and put it in the install script

* fixed syntax error
2021-01-19 16:25:08 -06:00
423625f718 Workaround for Non-release versions of FreeRDP
Related: #164
2021-01-06 11:56:21 -06:00
4e1cbc86bb Updated scripts for Guacamole version 1.3.0. (#162) 2021-01-03 09:16:32 -06:00
8da14b837b Add Support For Linux Mint (#161)
* Add Support For Linux Mint

* Add Linux Mint Debian Edition Support

Added LMDE to Debian Name Checks
2020-12-26 23:41:33 -06:00
40ae3174ea Update README.md 2020-07-05 17:53:36 -05:00
6254bbb017 Updated to version 1.2.0 and added missing libavformat-dev package. (#145) 2020-07-03 20:24:18 -05:00
e2cc87dbe3 fix 22 to 8080 2020-06-23 17:54:35 -05:00
4981b75511 Update README.md 2020-05-07 10:00:17 -05:00
1411f1b4de Add checks for ufw and iptables. Fixes #132 2020-05-07 09:38:39 -05:00
5 changed files with 326 additions and 57 deletions

View File

@ -1,35 +1,46 @@
# guac-install # guac-install
## NOTE: The version of FreeRDP2 that comes in the official repo for Ubuntu 18.04 is broken. If you are using Ubuntu 18.04 and RDP is not working / crashing run the following before or after 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.
## 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.
## NOTE: Ubuntu users having issues with RDP have reported the following fix:
``` ```
sudo add-apt-repository ppa:remmina-ppa-team/freerdp-daily sudo add-apt-repository ppa:remmina-ppa-team/remmina-next
sudo apt-get update sudo apt-get update
sudo apt-get install freerdp2-dev freerdp2-x11 sudo apt-get install freerdp2-dev freerdp2-x11
``` ```
Script for installing Guacamole 1.1.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/) 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. ## NOTE: Debian users having issues with RDP have reported the following fix:
```
sudo bash -c 'echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list.d/backports.list'
sudo apt update
sudo apt -y -t buster-backports install freerdp2-dev libpulse-dev
```
Run script, enter MySQL Root Password and Guacamole User password. Guacamole User is used to connect to the Guacamole Database. 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.
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. 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 ## 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 ## FYI
Here's a cool PowerShell module for using the Guacamole API: https://github.com/UpperM/guacamole-powershell 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 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: ## How to Run:
### Download file directly from here: ### Download file directly from here:
`wget https://git.io/fxZq5` `wget https://git.io/fxZq5 -O guac-install.sh`
### Make it executable: ### Make it executable:
@ -108,10 +119,9 @@ NOTE: Only the switches for MySQL Host, MySQL Port and Guacamole Database are av
## WARNING ## WARNING
- Upgrading from 0.9.14 -> 1.1.0 has not been tested, only 1.0.0 -> 1.1.0. - 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!
- Switches have changed and additional ones have been added!
## How to Run: ## How to Upgrade:
### Download file directly from here: ### Download file directly from here:
@ -130,3 +140,38 @@ Interactive (asks for passwords):
Non-Interactive (MySQL root password provided via cli): Non-Interactive (MySQL root password provided via cli):
`./guac-upgrade.sh --mysqlpwd password` `./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,7 +4,32 @@
if ! [ $(id -u) = 0 ]; then echo "Please run this script as sudo or root"; exit 1 ; fi if ! [ $(id -u) = 0 ]; then echo "Please run this script as sudo or root"; exit 1 ; fi
# Version number of Guacamole to install # Version number of Guacamole to install
GUACVERSION="1.1.0" GUACVERSION="1.5.3"
# Initialize variable values
installTOTP=""
installDUO=""
# This is where we'll store persistent data for guacamole
INSTALLFOLDER="/opt/guacamole"
# This is where we'll store persistent data for mysql
MYSQLDATAFOLDER="/opt/mysql"
# Make folders!
mkdir -p ${INSTALLFOLDER}/install_files
mkdir ${INSTALLFOLDER}/extensions
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 # Get script arguments for non-interactive mode
while [ "$1" != "" ]; do while [ "$1" != "" ]; do
@ -17,11 +42,17 @@ while [ "$1" != "" ]; do
shift shift
guacpwd="$1" guacpwd="$1"
;; ;;
-t | --totp )
installTOTP=true
;;
-d | --duo )
installDUO=true
esac esac
shift shift
done done
# Get MySQL root password and Guacamole User password # Get MySQLroot password and Guacamole User password
if [ -n "$mysqlpwd" ] && [ -n "$guacpwd" ]; then if [ -n "$mysqlpwd" ] && [ -n "$guacpwd" ]; then
mysqlrootpassword=$mysqlpwd mysqlrootpassword=$mysqlpwd
guacdbuserpassword=$guacpwd guacdbuserpassword=$guacpwd
@ -51,9 +82,71 @@ else
echo echo
fi fi
# Install Stuff if [[ -z "${installTOTP}" ]]; 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? (y/N): ${NC}"
read PROMPT
if [[ ${PROMPT} =~ ^[Yy]$ ]]; then
installTOTP=true
else
installTOTP=false
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
apt-get update apt-get update
apt-get -y install docker-ce mysql-client wget apt-get -y install wget
# Check if mysql client already installed
if [ -x "$(command -v mysql)" ]; then
echo "mysql detected!"
else
# Install mysql-client
apt-get -y install default-mysql-client
if [ $? -ne 0 ]; then
echo "Failed to install apt prerequisites: default-mysql-client"
echo "Try manually isntalling this prerequisites and try again"
exit
fi
fi
# Check if docker already installed
if [ -x "$(command -v docker)" ]; then
echo "docker detected!"
else
echo "Installing docker"
# Try to install docker from the official repo
apt-get -y install docker-ce docker-ce-cli containerd.io
if [ $? -ne 0 ]; then
echo "Failed to install docker via official apt repo"
echo "Trying to install docker from https://get.docker.com"
wget -O get-docker.sh https://get.docker.com
chmod +x ./get-docker.sh
./get-docker.sh
if [ $? -ne 0 ]; then
echo "Failed to install docker from https://get.docker.com"
exit
fi
fi
fi
# Set SERVER to be the preferred download server from the Apache CDN # Set SERVER to be the preferred download server from the Apache CDN
SERVER="http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/${GUACVERSION}" SERVER="http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/${GUACVERSION}"
@ -68,12 +161,69 @@ fi
tar -xzf guacamole-auth-jdbc-${GUACVERSION}.tar.gz tar -xzf guacamole-auth-jdbc-${GUACVERSION}.tar.gz
# Start MySQL
docker run --restart=always --detach --name=mysql --env="MYSQL_ROOT_PASSWORD=$mysqlrootpassword" --publish 3306:3306 mysql
# Sleep to let MySQL load (there's probably a better way to do this) # Download and install TOTP
echo "Waiting 30 seconds for MySQL to load" if [ "${installTOTP}" = true ]; then
sleep 30 wget -q --show-progress -O guacamole-auth-totp-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-totp-${GUACVERSION}.tar.gz
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to download guacamole-auth-totp-${GUACVERSION}.tar.gz" 1>&2
echo -e "${SERVER}/binary/guacamole-auth-totp-${GUACVERSION}.tar.gz"
exit 1
else
echo -e "${GREEN}Downloaded guacamole-auth-totp-${GUACVERSION}.tar.gz${NC}"
tar -xzf guacamole-auth-totp-${GUACVERSION}.tar.gz
echo -e "${BLUE}Moving guacamole-auth-totp-${GUACVERSION}.jar (${INSTALLFOLDER}/extensions/)...${NC}"
cp -f guacamole-auth-totp-${GUACVERSION}/guacamole-auth-totp-${GUACVERSION}.jar ${INSTALLFOLDER}/extensions/
echo
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
# Wait for the MySQL Health Check equal "healthy"
echo "Waiting for MySQL to be healthy"
until [ "$(/usr/bin/docker inspect -f {{.State.Health.Status}} mysql)" == "healthy" ]; do
sleep 0.1;
done;
# Create the Guacamole database and the user account # Create the Guacamole database and the user account
# SQL Code # SQL Code
@ -88,7 +238,12 @@ echo $SQLCODE | mysql -h 127.0.0.1 -P 3306 -u root -p$mysqlrootpassword
cat guacamole-auth-jdbc-${GUACVERSION}/mysql/schema/*.sql | mysql -u root -p$mysqlrootpassword -h 127.0.0.1 -P 3306 guacamole_db cat guacamole-auth-jdbc-${GUACVERSION}/mysql/schema/*.sql | mysql -u root -p$mysqlrootpassword -h 127.0.0.1 -P 3306 guacamole_db
docker run --restart=always --name guacd -d guacamole/guacd docker run --restart=always --name guacd --detach guacamole/guacd:${GUACVERSION}
docker run --restart=always --name guacamole --link mysql:mysql --link guacd:guacd -e MYSQL_HOSTNAME=127.0.0.1 -e MYSQL_DATABASE=guacamole_db -e MYSQL_USER=guacamole_user -e MYSQL_PASSWORD=$guacdbuserpassword --detach -p 8080:8080 guacamole/guacamole docker run --restart=always --name guacamole --detach --link mysql:mysql --link guacd:guacd -v ${INSTALLFOLDER}:/etc/guacamole -e MYSQL_HOSTNAME=127.0.0.1 -e MYSQL_DATABASE=guacamole_db -e MYSQL_USER=guacamole_user -e MYSQL_PASSWORD=$guacdbuserpassword -e GUACAMOLE_HOME=/etc/guacamole -p 8080:8080 guacamole/guacamole:${GUACVERSION}
rm -rf guacamole-auth-jdbc-${GUACVERSION}* # 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

View File

@ -4,11 +4,11 @@
if ! [ $(id -u) = 0 ]; then echo "Please run this script as sudo or root"; exit 1 ; fi if ! [ $(id -u) = 0 ]; then echo "Please run this script as sudo or root"; exit 1 ; fi
# Version number of Guacamole to install # Version number of Guacamole to install
GUACVERSION="1.1.0" GUACVERSION="1.5.3"
# Different version of Ubuntu and Debian have different package names... # Different version of Ubuntu/Linux Mint and Debian have different package names...
source /etc/os-release source /etc/os-release
if [[ "${NAME}" == "Ubuntu" ]]; then if [[ "${NAME}" == "Ubuntu" ]] || [[ "${NAME}" == "Linux Mint" ]]; then
# Ubuntu > 18.04 does not include universe repo by default # Ubuntu > 18.04 does not include universe repo by default
# Add the "Universe" repo, don't update # Add the "Universe" repo, don't update
add-apt-repository -yn universe add-apt-repository -yn universe
@ -20,29 +20,29 @@ if [[ "${NAME}" == "Ubuntu" ]]; then
else else
LIBPNG="libpng-dev" LIBPNG="libpng-dev"
fi fi
elif [[ "${NAME}" == *"Debian"* ]] || [[ "${NAME}" == *"Raspbian GNU/Linux"* ]] || [[ "${NAME}" == *"Kali GNU/Linux"* ]]; then elif [[ "${NAME}" == *"Debian"* ]] || [[ "${NAME}" == *"Raspbian GNU/Linux"* ]] || [[ "${NAME}" == *"Kali GNU/Linux"* ]] || [[ "${NAME}" == "LMDE" ]]; then
JPEGTURBO="libjpeg62-turbo-dev" JPEGTURBO="libjpeg62-turbo-dev"
if [[ "${PRETTY_NAME}" == *"stretch"* ]] || [[ "${PRETTY_NAME}" == *"buster"* ]] || [[ "${PRETTY_NAME}" == *"Kali GNU/Linux Rolling"* ]]; then if [[ "${PRETTY_NAME}" == *"bullseye"* ]] || [[ "${PRETTY_NAME}" == *"stretch"* ]] || [[ "${PRETTY_NAME}" == *"buster"* ]] || [[ "${PRETTY_NAME}" == *"Kali GNU/Linux Rolling"* ]] || [[ "${NAME}" == "LMDE" ]]; then
LIBPNG="libpng-dev" LIBPNG="libpng-dev"
else else
LIBPNG="libpng12-dev" LIBPNG="libpng12-dev"
fi fi
else else
echo "Unsupported Distro - Ubuntu, Debian, Kali or Raspbian Only" echo "Unsupported Distro - Ubuntu, Linux Mint, Debian, Kali or Raspbian Only"
exit 1 exit 1
fi fi
# Install Server Features # Install Server Features
apt-get -qq update apt-get -qq update
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
apt-get -y install build-essential libcairo2-dev ${JPEGTURBO} ${LIBPNG} libossp-uuid-dev libavcodec-dev libavutil-dev \ 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 \ libswscale-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev \
libvorbis-dev libwebp-dev libwebsockets-dev wget libtool-bin libvorbis-dev libwebp-dev libwebsockets-dev freerdp2-x11 libtool-bin ghostscript dpkg-dev wget crudini libc-bin
# If apt fails to run completely the rest of this isn't going to work... # If apt fails to run completely the rest of this isn't going to work...
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "apt-get failed to install all required dependencies." echo "apt-get failed to install all required dependencies."
exit exit 1
fi fi
# Set SERVER to be the preferred download server from the Apache CDN # 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 # Download Guacamole Server
wget -O guacamole-server-${GUACVERSION}.tar.gz ${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz wget -O guacamole-server-${GUACVERSION}.tar.gz ${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed to download guacamole-server-${GUACVERSION}.tar.gz" echo -e "${RED}Failed to download guacamole-server-${GUACVERSION}.tar.gz" 1>&2
echo "${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz" echo -e "${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz${NC}"
exit exit 1
else else
# Extract Guacamole Files # Extract Guacamole Files
tar -xzf guacamole-server-${GUACVERSION}.tar.gz tar -xzf guacamole-server-${GUACVERSION}.tar.gz
@ -64,7 +64,7 @@ mkdir -p /etc/guacamole
# Install guacd (Guacamole-server) # Install guacd (Guacamole-server)
cd guacamole-server-${GUACVERSION} cd guacamole-server-${GUACVERSION}
./configure --with-init-dir=/etc/init.d ./configure --with-systemd-dir=/etc/systemd/system
make make
make install make install

View File

@ -15,11 +15,11 @@ fi
# Version number of Guacamole to install # Version number of Guacamole to install
# Homepage ~ https://guacamole.apache.org/releases/ # Homepage ~ https://guacamole.apache.org/releases/
GUACVERSION="1.1.0" GUACVERSION="1.5.3"
# Latest Version of MySQL Connector/J if manual install is required (if libmariadb-java/libmysql-java is not available via apt) # 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/ # Homepage ~ https://dev.mysql.com/downloads/connector/j/
MCJVER="8.0.19" MCJVER="8.0.27"
# Colors to use for output # Colors to use for output
YELLOW='\033[1;33m' YELLOW='\033[1;33m'
@ -101,7 +101,7 @@ done
if [[ -z "${installTOTP}" ]] && [[ "${installDuo}" != true ]]; then if [[ -z "${installTOTP}" ]] && [[ "${installDuo}" != true ]]; then
# Prompt the user if they would like to install TOTP MFA, default of no # 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? (y/N): ${NC}" echo -e -n "${CYAN}MFA: Would you like to install TOTP (choose 'N' if you want Duo)? (y/N): ${NC}"
read PROMPT read PROMPT
if [[ ${PROMPT} =~ ^[Yy]$ ]]; then if [[ ${PROMPT} =~ ^[Yy]$ ]]; then
installTOTP=true installTOTP=true
@ -212,12 +212,12 @@ if [ "${installMySQL}" = true ]; then
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ${mysqlRootPwd}" debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ${mysqlRootPwd}"
fi fi
# Different version of Ubuntu and Debian have different package names... # Different version of Ubuntu/Linux Mint and Debian have different package names...
source /etc/os-release source /etc/os-release
if [[ "${NAME}" == "Ubuntu" ]]; then if [[ "${NAME}" == "Ubuntu" ]] || [[ "${NAME}" == "Linux Mint" ]]; then
# Ubuntu > 18.04 does not include universe repo by default # Ubuntu > 18.04 does not include universe repo by default
# Add the "Universe" repo, don't update # Add the "Universe" repo, don't update
add-apt-repository -yn universe add-apt-repository -y universe
# Set package names depending on version # Set package names depending on version
JPEGTURBO="libjpeg-turbo8-dev" JPEGTURBO="libjpeg-turbo8-dev"
if [[ "${VERSION_ID}" == "16.04" ]]; then if [[ "${VERSION_ID}" == "16.04" ]]; then
@ -233,9 +233,9 @@ if [[ "${NAME}" == "Ubuntu" ]]; then
else else
MYSQL="mysql-client" MYSQL="mysql-client"
fi fi
elif [[ "${NAME}" == *"Debian"* ]] || [[ "${NAME}" == *"Raspbian GNU/Linux"* ]] || [[ "${NAME}" == *"Kali GNU/Linux"* ]]; then elif [[ "${NAME}" == *"Debian"* ]] || [[ "${NAME}" == *"Raspbian GNU/Linux"* ]] || [[ "${NAME}" == *"Kali GNU/Linux"* ]] || [[ "${NAME}" == "LMDE" ]]; then
JPEGTURBO="libjpeg62-turbo-dev" JPEGTURBO="libjpeg62-turbo-dev"
if [[ "${PRETTY_NAME}" == *"stretch"* ]] || [[ "${PRETTY_NAME}" == *"buster"* ]] || [[ "${PRETTY_NAME}" == *"Kali GNU/Linux Rolling"* ]]; then if [[ "${PRETTY_NAME}" == *"bullseye"* ]] || [[ "${PRETTY_NAME}" == *"stretch"* ]] || [[ "${PRETTY_NAME}" == *"buster"* ]] || [[ "${PRETTY_NAME}" == *"Kali GNU/Linux Rolling"* ]] || [[ "${NAME}" == "LMDE" ]]; then
LIBPNG="libpng-dev" LIBPNG="libpng-dev"
else else
LIBPNG="libpng12-dev" LIBPNG="libpng12-dev"
@ -249,7 +249,7 @@ elif [[ "${NAME}" == *"Debian"* ]] || [[ "${NAME}" == *"Raspbian GNU/Linux"* ]]
MYSQL="default-mysql-client" MYSQL="default-mysql-client"
fi fi
else else
echo "Unsupported distribution - Debian, Kali, Raspbian or Ubuntu only" echo "Unsupported distribution - Debian, Kali, Raspbian, Linux Mint or Ubuntu only"
exit 1 exit 1
fi fi
@ -302,11 +302,9 @@ echo -e "${BLUE}Installing packages. This might take a few minutes...${NC}"
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
# Required packages # Required packages
apt-get -y install build-essential libcairo2-dev ${JPEGTURBO} ${LIBPNG} libossp-uuid-dev libavcodec-dev libavutil-dev \ 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 \ libswscale-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev \
libvorbis-dev libwebp-dev libwebsockets-dev \ libvorbis-dev libwebp-dev libwebsockets-dev freerdp2-x11 libtool-bin ghostscript dpkg-dev wget crudini libc-bin \
freerdp2-x11 libtool-bin ghostscript dpkg-dev \
wget crudini \
${MYSQL} ${LIBJAVA} ${TOMCAT} &>> ${LOG} ${MYSQL} ${LIBJAVA} ${TOMCAT} &>> ${LOG}
# If apt fails to run completely the rest of this isn't going to work... # If apt fails to run completely the rest of this isn't going to work...
@ -406,16 +404,32 @@ rm -rf /etc/guacamole/extensions/
mkdir -p /etc/guacamole/lib/ mkdir -p /etc/guacamole/lib/
mkdir -p /etc/guacamole/extensions/ mkdir -p /etc/guacamole/extensions/
# 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
# Install guacd (Guacamole-server) # Install guacd (Guacamole-server)
cd guacamole-server-${GUACVERSION}/ cd guacamole-server-${GUACVERSION}/
echo -e "${BLUE}Building Guacamole-Server with GCC $( gcc --version | head -n1 | grep -oP '\)\K.*' | awk '{print $1}' ) ${NC}" 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}" echo -e "${BLUE}Configuring Guacamole-Server. This might take a minute...${NC}"
./configure --with-init-dir=/etc/init.d &>> ${LOG} ./configure --with-systemd-dir=/etc/systemd/system &>> ${LOG}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "${RED}Failed. See ${LOG}${NC}" 1>&2 echo "Failed to configure guacamole-server"
exit 1 echo "Trying again with --enable-allow-freerdp-snapshots"
./configure --with-systemd-dir=/etc/systemd/system --enable-allow-freerdp-snapshots
if [ $? -ne 0 ]; then
echo "Failed to configure guacamole-server - again"
exit
fi
else else
echo -e "${GREEN}OK${NC}" echo -e "${GREEN}OK${NC}"
fi fi
@ -628,6 +642,14 @@ else
fi fi
echo 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 # Ensure guacd is started
echo -e "${BLUE}Starting guacd service & enable at boot...${NC}" echo -e "${BLUE}Starting guacd service & enable at boot...${NC}"
service guacd stop 2>/dev/null service guacd stop 2>/dev/null
@ -635,6 +657,36 @@ service guacd start
systemctl enable guacd systemctl enable guacd
echo echo
# Deal with ufw and/or iptables
# Check if ufw is a valid command
if [ -x "$( command -v ufw )" ]; then
# Check if ufw is active (active|inactive)
if [[ $(ufw status | grep inactive | wc -l) -eq 0 ]]; then
# Check if 8080 is not already allowed
if [[ $(ufw status | grep "8080/tcp" | grep "ALLOW" | grep "Anywhere" | wc -l) -eq 0 ]]; then
# ufw is running, but 8080 is not allowed, add it
ufw allow 8080/tcp comment 'allow tomcat'
fi
fi
fi
# It's possible that someone is just running pure iptables...
# Check if iptables is a valid running service
systemctl is-active --quiet iptables
if [ $? -eq 0 ]; then
# Check if 8080 is not already allowed
# FYI: This same command matches the rule added with ufw (-A ufw-user-input -p tcp -m tcp --dport 22 -j ACCEPT)
if [[ $(iptables --list-rules | grep -- "-p tcp" | grep -- "--dport 8080" | grep -- "-j ACCEPT" | wc -l) -eq 0 ]]; then
# ALlow it
iptables -A INPUT -p tcp --dport 8080 --jump ACCEPT
fi
fi
# I think there is another service called firewalld that some people could be running instead
# Unless someone opens an issue about it or submits a pull request, I'm going to ignore it for now
# Cleanup # Cleanup
echo -e "${BLUE}Cleanup install files...${NC}" echo -e "${BLUE}Cleanup install files...${NC}"
rm -rf guacamole-* rm -rf guacamole-*

View File

@ -4,7 +4,7 @@
if ! [ $(id -u) = 0 ]; then echo "Please run this script as sudo or root"; exit 1 ; fi if ! [ $(id -u) = 0 ]; then echo "Please run this script as sudo or root"; exit 1 ; fi
# Version number of Guacamole to install # Version number of Guacamole to install
GUACVERSION="1.1.0" GUACVERSION="1.5.3"
# Colors to use for output # Colors to use for output
YELLOW='\033[1;33m' YELLOW='\033[1;33m'
@ -32,7 +32,7 @@ while [ "$1" != "" ]; do
;; ;;
-r | --mysqlpwd ) -r | --mysqlpwd )
shift shift
mysqlrootpwd="$1" mysqlRootPwd="$1"
;; ;;
esac esac
shift shift
@ -90,7 +90,7 @@ service guacd stop
apt-get -qq update apt-get -qq update
# Install additional packages if they do not exist yet # Install additional packages if they do not exist yet
apt-get -y install freerdp2-dev freerdp2-x11 libtool-bin libwebsockets-dev apt-get -y install freerdp2-dev freerdp2-x11 libtool-bin libwebsockets-dev libavformat-dev
# Download Guacamole server # Download Guacamole server
wget -q --show-progress -O guacamole-server-${GUACVERSION}.tar.gz ${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz wget -q --show-progress -O guacamole-server-${GUACVERSION}.tar.gz ${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz
@ -124,7 +124,16 @@ fi
# Upgrade Guacamole Server # Upgrade Guacamole Server
cd guacamole-server-${GUACVERSION} cd guacamole-server-${GUACVERSION}
./configure --with-init-dir=/etc/init.d ./configure --with-systemd-dir=/etc/systemd/system
if [ $? -ne 0 ]; then
echo "Failed to configure guacamole-server"
echo "Trying again with --enable-allow-freerdp-snapshots"
./configure --with-systemd-dir=/etc/systemd/system --enable-allow-freerdp-snapshots
if [ $? -ne 0 ]; then
echo "Failed to configure guacamole-server - again"
exit
fi
fi
make make
make install make install
@ -188,6 +197,14 @@ for file in /etc/guacamole/extensions/guacamole-auth-duo*.jar; do
fi fi
done 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 # Start tomcat and Guacamole
echo -e "${BLUE}Starting tomcat and guacamole...${NC}" echo -e "${BLUE}Starting tomcat and guacamole...${NC}"
service ${TOMCAT} start service ${TOMCAT} start