There is no /etc/default/su file by default, but if you create one and
put

ALWAYS_SET_PATH yes

in it, then su *does* change the PATH variable, and this avoids the warning
message from login.

ii  util-linux     2.33.1-0.1   amd64        miscellaneous system utilities

unicorn:~$ cat /etc/default/su
ALWAYS_SET_PATH yes
unicorn:~$ echo "$PATH"
/home/greg/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin
unicorn:~$ su
Password:
root@unicorn:/home/greg# echo "$PATH"
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@unicorn:/home/greg#

Reply via email to