pam_loginuid — Record user's login uid to the process attribute

Synopsis [require_auditd]


The pam_loginuid module sets the loginuid process attribute for the process that was authenticated. This is necessary for applications to be correctly audited. This PAM module should only be used for entry point applications like: login, sshd, gdm, vsftpd, crond and atd. There are probably other entry point applications besides these. You should not use it for applications like sudo or su as that defeats the purpose by changing the loginuid to the account they just switched to.



This option, when given, will cause this module to query the audit daemon status and deny logins if it is not running.

Module Types Provided

Only the session module type is provided.

Return Values


The loginuid value is set and auditd is running if check requested.


The /proc/self/loginuid file is not present on the system or the login process runs inside uid namespace and kernel does not support overwriting loginuid.


Any other error prevented setting loginuid or auditd is not running.


auth       required
auth       required
account    required
password   required
session    required
session    required

See Also

pam.conf(5), pam.d(5), pam(8), auditctl(8), auditd(8)


pam_loginuid was written by Steve Grubb <>

Referenced By

audit_setloginuid(3), ausearch(8), pam_systemd(8).

05/18/2017 Linux-PAM Manual