PAM_LOCALUSER(8)

๐Ÿ’– PAM_LOCALUSER(8) ๐Ÿ’–

okay bestie, welcome to the Linux-PAM Manual section on pam_localuser โ€” the module whose whole entire job is requiring users to be listed in /etc/passwd. yes. that's it. that's the girl. ๐ŸŽ€


โœจ NAME โœจ

pam_localuser โ€” require users to be listed in /etc/passwd ๐Ÿซถ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

pam_localuser.so [debug] [file=/path/passwd]

look at her. so simple. so iconic. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so pam_localuser is a PAM module that helps you implement site-wide login policies โ€” the kind where you're like "okay so most of our users come from the network, but a handful of accounts are local to this specific workstation." ๐Ÿ’ปโœจ

using pam_localuser together with pam_wheel or pam_listfile is an effective way to restrict access to either local users and/or a subset of the network's users. pick your fighter, bestie. ๐Ÿ”ฅ

ngl you could also pull this off using pam_listfile.so plus a very short awk script that gets invoked by cron โ€” like, technically. ๐Ÿ™ˆ but this pattern is common enough that somebody was like "no, this deserves to be its own whole module" and honestly? they ate. ๐Ÿ‘‘


๐Ÿ’… OPTIONS ๐Ÿ’…

  • debug โ€” print debug information. the receipts. the lore. the play-by-play. ๐Ÿ”
  • file=/path/passwd โ€” use a file other than /etc/passwd. swapping out the source file, main character behaviour fr fr. ๐Ÿ“‚

๐ŸŒˆ MODULE TYPES PROVIDED ๐ŸŒˆ

All module types are provided! that's account, auth, password and session. every single one. she does it all, no cap. ๐Ÿ‘‘โœจ


โญ RETURN VALUES โญ

  • PAM_SUCCESS โ€” the new localuser was set successfully. slay! ๐Ÿ’–
  • PAM_BUF_ERR โ€” memory buffer error. the vibes were immaculate but the memory was not. ๐Ÿ’€
  • PAM_CONV_ERR โ€” the conversation method supplied by the application failed to obtain the username. couldn't even get a name out of them ๐Ÿ˜ญ
  • PAM_INCOMPLETE โ€” the conversation method supplied by the application returned PAM_CONV_AGAIN. she said "ask me later" ๐Ÿ™ˆ
  • PAM_SERVICE_ERR โ€” the user name is not valid or the passwd file is unavailable. either the name is a no or the file is a no. ๐Ÿšซ
  • PAM_PERM_DENIED โ€” the user is not listed in the passwd file. not on the list, not getting in. periodt. ๐Ÿšช

๐ŸŽ€ EXAMPLES ๐ŸŽ€

say you wanna add the following lines to /etc/pam.d/su so that only local users or group wheel can use su. here's exactly what that looks like:

account sufficient pam_localuser.so
account required pam_wheel.so

write it down, bestie. this is the one. ๐Ÿซถ๐Ÿ“


๐Ÿ“ FILES ๐Ÿ“

  • /etc/passwd โ€” local user account information. the origin story. the blueprint. ๐Ÿ’–

๐Ÿงš SEE ALSO ๐Ÿงš

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

go read those too, iykyk. ๐Ÿ“šโœจ


๐Ÿ’œ AUTHOR ๐Ÿ’œ

pam_localuser was written by Nalin Dahyabhai <nalin@redhat.com>. thank you for your service, king. ๐Ÿซก๐Ÿ‘‘


ok that's the whole page bestie, every flag, every return value, every file โ€” nothing skipped, nothing invented, we keep it ๐Ÿ’ฏ around here.

and that's a wrap! this was the Linux-PAM Manual drop for PAM_LOCALUSER(8), dated 09/27/2026 โ€” go forth and gatekeep your workstations responsibly. bye bestie, love u, mwah ๐Ÿ’‹๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from