> Consider this python sample and assume it’s automatically being run at logon from the .bashrc of a technical account, such as postgres, to which the root user changes by typing su - postgres
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)."
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)."