This question already has an answer here:
When I am changing (on my debian box) to the root user with
su, apparently the PATH is not correctly set. Some vital directories like
usr/local/sbin are missing.
/etc/profile I have the following lines (apparently standard default stuff not written by me):
if [ "`id -u`" -eq 0]; then PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin/:/usr/bin:/sbin:/bin" else PATH="/usr/local/bin:/usr/bin:/bin" fi export PATH
/etc/login.defs I have (also default stuff):
Why is my PATH not correctly set when I do