Regarding an SSH session (boundary condition SHLVL=1) `exec login [username]' does the job. I frequently used `login [username]' within older Debian operating system environments (up to Debian 12) in order to test complex initialization tasks on behalf different user personalities. Using `su -l [username]' and setting up necessary parts of the environment manually (beforehand) does not constitute the same workflow. Remarkably, the util-linux `login' (1) man page declares the usage of the `vhangup' syscall as a buggy implementation for itself "A recursive login, as used to be possible in the good old days, no longer works; for most purposes su(1) is a satisfactory substitute. Indeed, for security reasons, login does a vhangup(2) system call to remove any possible listening processes on the tty. This is to avoid password sniffing. If one uses the command login, then the surrounding shell gets killed by vhangup(2) because it’s no longer the true owner of the tty. This can be avoided by using exec login in a top-level shell or xterm." due to qualified security reasons. The term "recursive login" sounds very funny to me in this context. (((8-DDD
Have you filed a bug report?
Why should I? That's a very bad idea! It is not a BUG, it's a FEATURE being introduced by retirement of the old "shadow-utils" implementation of the `login' program. On 10/7/25 14:31, John Hasler wrote:
What is the use case for running login in a running session? Have you filed a bug report?
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature