PAM_WTMPDB(8)

๐Ÿ“ฆ
version 0.75.0 ยท 4 versions
, in ubuntu resolute, ubuntu stonking

๐Ÿ’– PAM_WTMPDB(8) โ€” pam_wtmpdb ๐Ÿ’–

okay bestie, sit down, hydrate, because we're talking about the little PAM module that keeps receipts on when you log in and when you log out ๐Ÿซถ


โœจ NAME โœจ

pam_wtmpdb โ€” a PAM module that records login and logout times of users. it's giving timekeeper. it's giving someone is watching your 3am logins ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

pam_wtmpdb.so [debug] [silent] [skip_if=<services>] [database=<file>]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so pam_wtmpdb is a PAM module that records the login and logout information of the user. literally its whole personality. it uses /var/log/wtmp.db as its database file to store all that information, no cap ๐Ÿ—„๏ธโœจ

and compared to some wtmp(5) implementations? this PAM module is Y2038 safe and uses sqlite3 to store the information. future-proof queen behavior, we love to see it ๐Ÿ‘‘


๐Ÿ’… OPTIONS ๐Ÿ’…

  • debug โ€” print debug information. spill the tea about what's happening internally ๐Ÿ”
  • silent โ€” avoid all messages except errors. quiet luxury, but for logging ๐Ÿคซ
  • 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. so basically "don't record me for these, thank you next" ๐Ÿ™ˆ
  • database=<file> โ€” use file instead of /var/log/wtmp.db. you can have your db wherever you want, main character energy ๐ŸŽ€

๐ŸŒˆ MODULE TYPES PROVIDED ๐ŸŒˆ

the session module type is provided for updating the wtmp database with the login and logout information about an user. session only, and it ate ๐Ÿ’–


โญ RETURN VALUES โญ

  • PAM_SUCCESS โ€” everything was successful. slay, we love a clean run โœจ
  • PAM_SERVICE_ERR โ€” internal service module error. this includes error reading from or writing to the database. the db said "not today" ๐Ÿ˜ญ
  • PAM_USER_UNKNOWN โ€” user not known. who is she? we don't know her ๐Ÿ’€
  • PAM_IGNORE โ€” returned by service types which do nothing. it's just vibing, doing absolutely nothing, and that's valid ๐Ÿงš

๐Ÿ“ 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

one line. one line and your logins are getting documented. iconic honestly ๐Ÿซถ


๐Ÿ’œ FILES ๐Ÿ’œ

  • /var/log/wtmp.db โ€” the wtmpdb logging database file ๐Ÿ“‚
  • /var/lib/wtmpdb/wtmp.db โ€” a symbolic link from the upstream location to the above database file ๐Ÿ”—

๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

wtmpdb(8), pam.conf(5), pam.d(5), pam(8)

go read those too, bestie, i'm not doing all the homework for you ๐Ÿ“š


๐ŸŽ€ AUTHOR ๐ŸŽ€

pam_wtmpdb was written by Thorsten Kukuk <kukuk@suse.com>. thank you king, we appreciate you ๐Ÿ’–


and that's the whole page, fr fr. no notes. periodt. ๐Ÿ’…

this has been wtmpdb 0.75.0, dated 12/02/2025, signing off โ€” stay safe, stay logged, stay Y2038-ready babes ๐Ÿฆ‹โœจ

๐Ÿ“ฆ where this page comes from