Open vmdude opened 6 months ago
Hi @vmdude, we're adding zypper support to the one-line installation script today. Please let me know if that addresses the issue!
Hi @vmdude, we're adding zypper support to the one-line installation script today. Please let me know if that addresses the issue!
I tried now and the problem still persists.
~> curl https://goteleport.com/static/install.sh | bash -s 14.3.7
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11574 0 11574 0 0 160k 0 --:--:-- --:--:-- --:--:-- 161k
There is no officially supported package for your package manager. Downloading and installing Teleport via curl.
Downloading https://cdn.teleport.dev/teleport-v14.3.7-linux-amd64-bin.tar.gz
+ sudo curl -fL -o /tmp/teleport-xMEiLzsNu4/teleport-v14.3.7-linux-amd64-bin.tar.gz https://cdn.teleport.dev/teleport-v14.3.7-linux-amd64-bin.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 149M 100 149M 0 0 56.8M 0 0:00:02 0:00:02 --:--:-- 56.7M
+ set +x
Downloading https://cdn.teleport.dev/teleport-v14.3.7-linux-amd64-bin.tar.gz.sha256
+ sudo curl -fL -o /tmp/teleport-xMEiLzsNu4/teleport-v14.3.7-linux-amd64-bin.tar.gz.sha256 https://cdn.teleport.dev/teleport-v14.3.7-linux-amd64-bin.tar.gz.sha256
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 106 100 106 0 0 4219 0 --:--:-- --:--:-- --:--:-- 4240
+ set +x
+ cd /tmp/teleport-xMEiLzsNu4
+ sudo 'shasum -a 256' -c /tmp/teleport-xMEiLzsNu4/teleport-v14.3.7-linux-amd64-bin.tar.gz.sha256
sudo: shasum -a 256: comando não encontrado
~> cat /etc/os-release
NAME="openSUSE Leap"
VERSION="15.5"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.5"
PRETTY_NAME="openSUSE Leap 15.5"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.5"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Leap"
LOGO="distributor-logo-Leap"
This issue is also present on Fedora and likely affects other Linux distributions due to how the script is executed in Bash. The problem occurs with the installer script hosted at https://goteleport.com/static/install.sh.
Specifically, the issue stems from how $SHA_COMMAND
is quoted on line 205. In the current script, the command and its arguments are enclosed within quotes, which Bash interprets as a single string. This prevents the arguments from being recognised separately, as also noted by @vmdude.
One solution would be to remove the quotes from around $SHA_COMMAND
, changing the line from:
$SUDO "$SHA_COMMAND" -c "$TMP_CHECKSUM"
to:
$SUDO $SHA_COMMAND -c "$TMP_CHECKSUM"
I couldn't locate the source code for this script in the repository. If someone can show me where it is, I’d love to help fix it with a pull request.
Thank you, @dgiorgio. However, the file linked doesn't run the hash compare as root, unlike what we are seeing in https://goteleport.com/static/install.sh. I also checked the history of the linked file, and it differs from the install.sh
found on the website. Could there be a mix-up, or might there be details I've overlooked?
Identical issue on Slackware 15.
Solved changing the install script w. this, using sha256sum instead of the other needing the argument:
# require shasum/sha256sum
SHA_COMMAND=""
if type sha256sum &>/dev/null; then
SHA_COMMAND="sha256sum"
else
echo "ERROR: This script requires sha256sum or shasum to validate the download. Please install it and try again."
exit 1
fi
Putting the sha256sum condition before the other is another viable option to fix the issue on Slackware but maybe can help on other distros too.
Then running the previously downloaded install script like this (x.x.x is the teleport version):
cat ./changedinstall.sh | bash -s x.x.x
This is now working for me on Fedora 39. The quotes were removed in the installer script.
Here is the relevant change in the script:
223c223,224
< $SUDO "$SHA_COMMAND" -c "$TMP_CHECKSUM"
---
> # shellcheck disable=SC2086
> $SUDO $SHA_COMMAND -c "$TMP_CHECKSUM"
We actually got an error with teleport agent installation (through
curl
step) that points to theshasum -a 256
usage withSHA_COMMAND
variable:When I'll look into the shell installation script on line 187 (the one generating the error) it seems that the line with issue is the way variable alias is enclosed with double quote:
A way to reproduce was:
It work well when
SHA_COMMAND
is a single command but when it contains arg, bash try to look into the command WITH arg as a single binary.Other information about system: