Red Hat Bugzilla – Bug 191135
/etc/profile pathmunging should add sbin dirs to non-root PATH
Last modified: 2015-03-04 20:16:56 EST
Description of problem:
The pathmunging in /etc/profile to add "/sbin:/usr/sbin:/usr/local/sbin" is
conditional on the effective user ID being root (0).
Many system administrators change this file to make the addition of the sbin
directories unconditional. Changing the default would reduce the temptation to
work as root when it is not strictly necessary and it make a plain 'su' much
more useful. The performance hit for searching the additional directories is
almost undetectable and no significant security issues would be introduced.
Version-Release number of selected component (if applicable): 2.5.49
Steps to Reproduce:
1. Start bash as a normal user.
2. Try to execute ifconfig, lsusb, lsof, runlevel, hwclock (and others) - all
commands that provide useful features when run without privilege.
- 'command not found'
- Commands should execute.
Because of consolehelper, the sbin directories should be placed at the end of
the path for the non-superuser, and should probably be placed at the start for
# Path manipulation
if [ $EUID = 0 ]; then
pathmunge /sbin after
pathmunge /usr/sbin after
pathmunge /usr/local/sbin after
Default should stay as we are right now, the above should rather go into
local config changes.
Florian La Roche