---
name: "pam_loginuid"
section: "8"
platform: "linux"
package: "pam"
version: "1.7.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pam_loginuid"
---

# pam\_loginuid(8)

Record user's login uid to the process attribute

## NAME

pam\_loginuid - Record user's login uid to the process attribute

## SYNOPSIS

**pam\_loginuid.so** \[require\_auditd\]

## 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.

## 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.

## MODULE TYPES PROVIDED

Only the **session** module type is provided.

## 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.

## 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
```

## SEE ALSO

[**pam.conf**(5)](/pam.conf/5.md), [**pam.d**(5)](/pam.d/5.md), [**pam**(8)](/pam/8.md), [**auditctl**(8)](/auditctl/8.md), [**auditd**(8)](/auditd/8.md)

## AUTHOR

pam\_loginuid was written by Steve Grubb \<sgrubb@redhat.com\>
