Open fspmarshall opened 1 year ago
We solve this in the Teleport AMIs (which use Amazon Linux) by updating secure_path
: https://github.com/gravitational/teleport/blob/2baa7e72d9c22fc5263d46a03a4ba1e17de74ffd/assets/aws/files/install.sh#L105-L106
That only really helps with sudo
though.
AFAIK this is only an issue on Amazon Linux - a stock Docker container seems to have /usr/local/bin
in $PATH
:
gus@apollo:~ % docker run --rm --name centos -it centos:7 /bin/bash -c "echo \$PATH"
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Installing the teleport
yum
packages oncentos7
andamzn2
(possibly other distros as well) results inteleport
andtctl
not being inPATH
when running commands as root. This is because these distros don't have/usr/local/bin
as part ofPATH
when running commands as root.This ends up being annoying if you want to write a script/program that depends on teleport without depending on absolute install location. It's especially annoying on auth servers since
tctl
is explicitly designed to be run as root.I'm not sure what the solution to this should be. Having package installation modify
PATH
to include/usr/local/bin
feels wrong. Maybe installing a symlink to/usr/bin
would work, tho I'm not sure what potential drawbacks/issues might arise from that.