Author Topic: Debian 10 missing /sbin and /usr/sbin path after su  (Read 10039 times)

netfreak

  • Administrator
  • Sr. Member

  • Offline
  • *****
  • 299
    • View Profile
    • Higher Intellect
Debian 10 missing /sbin and /usr/sbin path after su
« on: October 27, 2019, 08:27:00 pm »
Seems a new annoyance under Debian 10 is by default the /sbin and /usr/sbin paths are not part of the shell environment when you su to root. Workaround is to edit the /etc/login.defs and add "ALWAYS_SET_PATH yes" so the config should look something like this:

Code: [Select]
#
# *REQUIRED*  The default PATH settings, for superuser and normal users.
#
# (they are minimal, add the rest in the shell startup files)
ENV_SUPATH      PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV_PATH        PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
ALWAYS_SET_PATH yes

Relevant details found at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918754