/sbin:/usr/sbin in mortal's PATH

Michael A. Peters mpeters at mac.com
Sun May 7 05:33:41 UTC 2006


On Sat, 2006-05-06 at 15:40 -0400, Chris Tyler wrote:
> The /sbin and /usr/sbin directories contain many utilities that are
> useful to non-superusers, such as ifconfig, netstat, arp, fuser, lsusb,
> runlevel, dumpe2fs, hwclock, lsof, traceroute, and many others.
> Obviously, most of those utilities can do -more- when run as superuser,
> but that doesn't diminish their value to mortals.
> 
> For years, one of the first changes I've made to my Fedora (and RHL)
> systems is to comment out 'if' in /etc/profile that adds
> "/sbin:/usr/sbin:/usr/local/sbin" only to the path of the superuser:
> 
> 	# Path manipulation
> 	#if [ $EUID = 0 ]; then
> 	        pathmunge /sbin
> 	        pathmunge /usr/sbin
> 	        pathmunge /usr/local/sbin
> 	#fi
> 
> Here's my question: Why don't we take that 'if' in the
> default /etc/profile, so those directories are in everyone's (default)
> PATH? Reasoning:

Users who need it can add the following to their bash ~/.profile file:

export PATH=$PATH:/sbin:/usr/sbin

(or /sbin:/usr/sbin:$PATH )

or create symlinks to what they need in ~/bin/
or create a bashe alias
or ...

There is no need for /sbin, /usr/sbin, /usr/local/sbin

to be in the path of unprivileged user by default.
Users can change that themselves if they need them in their path -
either temporarily or permanently.




More information about the fedora-devel-list mailing list