PAM_LASTLOG2(8)

πŸ’… pam_lastlog2(8) β€” the PAM module that tells you when you were last here ✨

okay bestie, this one lives in the System Administration part of the manual, and it's literally just here to be like "hey girl, you last logged in then" 🫢


✨ NAME ✨

pam_lastlog2 β€” a PAM module to display the date of your last login 🌸


πŸŽ€ SYNOPSIS πŸŽ€

pam_lastlog2.so [debug] [silent] [silent_if=<services>]
[database=<file>]

no cap, that's the whole thing. short and slay πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so pam_lastlog2 is a PAM module whose whole job is to show a little line of info about the last login of the user. it keeps all that tea stored in the /var/lib/lastlog/lastlog2.db database file. that's the vault. πŸ”

and the way that it's better than pam_lastlog? two things, periodt:

  • it's Y2038 safe β€” no Y2K-ass sequel energy here, she'll still be fine after 2038 πŸ’€
  • it uses sqlite3 to store the information ✨

πŸ’– OPTIONS πŸ’–

  • debug β€” print debug information. she's telling you everything, main character transparency πŸ—£οΈ
  • silent β€” avoid all messages except errors, and don't inform the user about any previous login. she'll only update the /var/lib/lastlog/lastlog2.db database. lowkey mysterious of her πŸ™ˆ
  • silent_if=<services> β€” the argument services is a comma separated list of PAM services. if a service is listed here, the last login message will not be shown. so it's like a lil guest list β€” if you're on it, you don't get the message πŸŽ€
  • database=<file> β€” use file instead of /var/lib/lastlog/lastlog2.db. your database, your rules, bestie πŸ’…

🌈 MODULE TYPES PROVIDED 🌈

the session module type is provided. that's the one doing both jobs: displaying the information about the last login and updating the lastlog file. she's multitasking, she's booked, she's iconic πŸ‘‘


⭐ RETURN VALUES ⭐

  • PAM_SUCCESS β€” everything was successful. ate, no crumbs ✨
  • PAM_SERVICE_ERR β€” internal service module error. this includes error reading from or writing to the database. the vault said no 😭
  • PAM_USER_UNKNOWN β€” user not known. who is she? never heard of her πŸ’€
  • PAM_IGNORE β€” returned by service types which do nothing. she's literally just standing there, serving nothing 🫢

🌸 EXAMPLES 🌸

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

session  optional pam_lastlog2.so silent_if=gdm,gdm-password
ok so important note: it is up to the administrator to decide if the user can login (optional/required) when pam_lastlog2 has returned an error. that's a you decision, bestie, not a module decision πŸŽ€

πŸ‘‘ AUTHOR πŸ‘‘

pam_lastlog2 was written by Thorsten Kukuk <kukuk@suse.com>. thank you for your service, king πŸ«‘πŸ’œ


🧚 SEE ALSO 🧚

liblastlog2(3), pam.conf(5), pam.d(5), pam(8)

go read those too, iykyk πŸ“š


πŸ› REPORTING BUGS πŸ›

for bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>. tell them everything, don't be shy πŸ’…


🌟 AVAILABILITY 🌟

the pam_lastlog2 library is part of the util-linux package since version 2.40. it can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. go get her πŸ›οΈβœ¨


and that's the whole page, bestie!! this one is from util-linux 2.42.4, dated 2026-09-21 β€” mwah, love that for us πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from
  • arch rolling: util-linux 2.42.4-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms