6.18. pam_loginuid - record user's login uid to the process attribute
Prev | Chapter 6. A reference guide for available modules | Next

## 6.18. pam_loginuid - record user's login uid to the process attribute

`pam_loginuid.so` [ require_auditd ]

### 6.18.1. DESCRIPTION

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.

### 6.18.2. OPTIONS

require_auditd

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

### 6.18.3. MODULE TYPES PROVIDED

Only the `session` module type is provided.

### 6.18.4. RETURN VALUES

PAM_SUCCESS

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

PAM_IGNORE

  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.

PAM_SESSION_ERR

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

### 6.18.5. EXAMPLES

    #%PAM-1.0
    auth       required     pam_unix.so
    auth       required     pam_nologin.so
    account    required     pam_unix.so
    password   required     pam_unix.so
    session    required     pam_unix.so
    session    required     pam_loginuid.so

### 6.18.6. AUTHOR

pam_loginuid was written by Steve Grubb <sgrubb@redhat.com>

Prev | Up | Next
6.17. pam_localuser - require users to be listed in /etc/passwd | Home | 6.19. pam_mail - inform about available mail