On Wednesday 07 August 2019 22.25:01 Dr. Nikolaus Klepp wrote:
Ran into the same thing. Looks like when changing to
root via "su", the
environment and path is from the users .profile, which does not include
/sbin (any more?)
nik
Just after posting I found an "answer" that's more a puzzle to me but does
provide a solution.
Seems Buster changed the package providing su. I found this on StackExchange:
"Note that according to Debian Wiki, previous versions of Debian used a
version of su from the shadow source package, while Buster uses one from the
util-linux sources, which won't auto-add the /sbin and /usr/sbin directories
to PATH when switching to root. If you need to approximate the old behavior,
you can set ALWAYS_SET_PATH yes in /etc/login.defs. – telcoM Jul 6 at 20:23"
Some other place I read that "using su is bad" so we should now use "su
-" to
get a clean environment every time. ?!? . I allready never understood why
using sudo would be better than using su, now this stuff about environment
does not make sense to me either.
Anyway, for those of us using su and not wanting to change the way we use it,
just add ALWAYS_SET_PATH yes in /etc/login.defs and everything is fine.
Thierry