[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/profile should include sbin in PATH

On 19/12/99 Bdale Garbee wrote:

In most shops I'm aware of, the more widely accepted behavior is that users
log in as themselves and acquire transient superuser privs as necessary using
sudo, or super, or something like that.  In this model, the expected situation
is that everything one might want to execute as either root or non-root is
always in the PATH, and what you can actually run is controlled by permissions.

hmm even when i use sudo or su (without the - ) i seem to still get the right PATH:

[eb@plato eb]$ echo $PATH
[eb@plato eb]$ su
[root@plato eb]# echo $PATH
[root@plato eb]# cat /root/.bashrc | grep PATH
[root@plato eb]# sudo -V | grep PATH
Users in this group are exempt from password and PATH requirements: sudo
Value to override user's $PATH with: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R 6/bin
[root@plato eb]# exit
[eb@plato eb]$

I don't see the problem. and if your su does not do this (aherm redhat) then just do su - and you get root's environment as if you logged in proper. this is controlled on debian here:

[eb@plato eb]$ cat /etc/login.defs | grep -w PATH
# *REQUIRED*  The default PATH settings, for superuser and normal users.
ENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/l ocal/bin
ENV_PATH        PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
[eb@plato eb]$

I, too, find myself adding /usr/sbin:/sbin to PATH in every Debian
/etc/profile I get near...

with the exception of traceroute and a few others there are few utilities i miss when I am as normal user, and for those i just type the full path (or I could probably add symlinks to ~/bin)

Ethan Benson
To obtain my PGP key: http://www.alaska.net/~erbenson/pgp/

Reply to: