/etc/init.d in the default $PATH ?

Chris Adams cmadams at hiwaay.net
Sun Jan 28 03:16:44 UTC 2007


Once upon a time, Peter Gordon <peter at thecodergeek.com> said:
> Both su and sudo only change your effective user ID to that of the root
> user (in essence giving you root permissions to files/directories/etc.),
> but your environment (PATH, HOME, TMPDIR, etc.) all remain untouched. If
> you want to gain a full login shell as the root user (including your own
> environment and running root's login scripts), you need to use 'su -'.

The annoying thing about that is that "su -" also changes your current
working directory.  If you are in a directory and need to do something
to a file as root, you either "su" (and possible have to set your PATH
or explicitly call /usr/sbin/xyzzy) or you "su -" and hunt down the
directory again.

Personally, I drop an extra script in /etc/profile.d that (among other
things) adds /usr/local/sbin:/usr/sbin:/sbin to the PATH of all users.
It doesn't really hurt anything.
-- 
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.




More information about the fedora-devel-list mailing list