Re:Don't abuse su for dropping user privileges (2015)
by erik_seaberg on Friday May 26, 2023 @10:31PM
(#36091527)
Why does PAM have sessions? I thought it was a layer of indirection over whether you’re using a password file or NIS or LDAP to verify passwords.
From su man page: "su is mostly designed for unprivileged users, the recommended solution for privileged users (e.g., scripts executed by root) is to use non-set-user-ID command runuser(1) that does not require authentication and provides separate PAM configuration. If the PAM session is not required at all then the recommended solution is to use command setpriv(1)."