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

Re: setting path for root after "sudo su" and "sudo" for Debian Bullseye (11)



On Sun, May 22, 2022 at 09:37:43PM +0200, basti wrote:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918754#41
> 
> or use su -l

For the record, that URL says:

  This is a new behavior because the util-linux implementation of su is
  used now. See also /usr/share/doc/util-linux/NEWS.Debian.gz for more
  information.

  "If you want to restore behaviour more similar to
    the previous one you can add 'ALWAYS_SET_PATH yes' in /etc/login.defs."

The advice in the second paragraph will *technically* work, and for a
little while we thought it was the best available workaround.

However, there is a problem with that one: the settings in /etc/login.defs
are *also* read by the login(1) program.  If you add the indicated line
to /etc/login.defs then you will get a warning every time you login on
a text console.  The warning can be ignored, but it's confusing and scary.

Putting the line in /etc/default/su instead works much better.  That file
isn't read by login(1), so you don't get scary warnings on console logins.
That's why we changed the wiki to support that solution instead of the
older one.


Reply to: