If the user (non-root) doesn't have /sbin:/usr/sbin inside $PATH (as
present when invoking `mksh -l`, which causes /etc/profile to be
sourced and setting $PATH), then executing sudo might fail with:
| $ sudo apt-get install rdesktop
| [...]
| dpkg: warning: 'ldconfig' not found in PATH or not executable
| dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
| dpkg: error: 2 expected programs not found in PATH or not executable
| Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
Ensure to have a working $PATH setting when invoking sudo
by explicitly setting secure_path.
Closes: https://github.com/grml/grml/issues/144
# WARNING: Never allow external access to the $USERNAME user!!!
$USERNAME ALL=NOPASSWD: ALL
+# Path used for every command run from sudo
+Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+
# allow editing of files with editor:
# $USERNAME ALL=NOPASSWD: sudoedit