I do not know how to make Ubuntu 20.04 su
behave like Ubuntu 18.04 su
.
The difference is because in Ubuntu 20.04/Focal su
is provided by the util-linux
package. In Ubuntu 18.04/Bionic su
is provided by the login
package (built from the source package shadow
).
root@ubuntu:~# lsb_release -r
Release: 18.04
root@ubuntu:~# dpkg -S /bin/su
login: /bin/su
root@ubuntu:~# lsb_release -r
Release: 20.04
root@ubuntu:~# dpkg -S /bin/su
util-linux: /bin/su
A key implementation difference appears to be support for DEFAULT_HOME
in /etc/login.defs
. The manpage for Bionic's su
mentions in its Configuration section
DEFAULT_HOME (boolean)
Indicate if login is allowed if we can't cd to the home directory. Default is no.
If set to yes, the user will login in the root (/) directory if it is not possible to
cd to her home directory.
The manpage for Focal's version of su
does not mention DEFAULT_HOME
.
I found a few relevant entries in the changelog for the shadow
package
* Use explicit --without-su configure flag
-- Balint Reczey <[email protected]> Fri, 20 Dec 2019 16:39:40 +0100
...
* Drop Lintian override for su, it is not shipped in login anymore
-- Balint Reczey <[email protected]> Mon, 08 Jul 2019 15:58:46 +0200
...
* Stop shipping su and break old util-linux version. (See #833256)
-- Andreas Henriksson <[email protected]> Fri, 27 Jul 2018 10:07:37 +0200
It looks like the change was made upstream in Debian and coordinated in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833256 . The lack of DEFAULT_HOME
support is mentioned but is not considered a blocker.