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.dbdatabase. 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) whenpam_lastlog2has 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