---
name: "pam_wtmpdb"
section: "8"
platform: "linux"
package: "libpam-wtmpdb"
version: "0.73.0-3+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pam_wtmpdb"
---

# pam\_wtmpdb(8)

PAM module to record login and logout times of users

## NAME

pam\_wtmpdb - PAM module to record login and logout times of users

## SYNOPSIS

**pam\_wtmpdb.so** \[debug\] \[silent\] \[skip\_if=\<services\>\] \[database=\<file\>\]

## DESCRIPTION

pam\_wtmpdb is a PAM module to record the login and logout information of the user. The module uses /var/log/wtmp.db as database file to store all information.

Compared to some [**wtmp**(5)](/wtmp/5.md) implementations this PAM module is Y2038 safe and uses sqlite3 to store the information.

## OPTIONS

debug

Print debug information.

silent

Avoid all messages except errors.

skip\_if=\<services\>

The argument **services** is a comma separated list of PAM services. If a service is listed here, no wtmpdb entry is written.

database=\<file\>

Use **file** instead of /var/log/wtmp.db.

## MODULE TYPES PROVIDED

The **session** module type is provided for updating the wtmp database with the login and logout information about an user.

## RETURN VALUES

PAM\_SUCCESS

Everything was successful.

PAM\_SERVICE\_ERR

Internal service module error. This includes error reading from or writing to the database.

PAM\_USER\_UNKNOWN

User not known.

PAM\_IGNORE

Returned by service types which do nothing.

## EXAMPLES

Add the following line to e.g. /etc/pam.d/login to display the last login time of a user:

```
      session  required  pam_wtmpdb.so
```

## FILES

/var/log/wtmp.db

Wtmpdb logging database file

/var/lib/wtmpdb/wtmp.db

Symbolic link from the upstream location to the above database file

## SEE ALSO

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

## AUTHOR

pam\_wtmpdb was written by Thorsten Kukuk \<kukuk@suse.com\>.
