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 returnedPAM_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 ๐ง
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
- arch rolling: pam 1.7.3-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms