PAM_USERTYPE(8)

๐Ÿ’– PAM_USERTYPE ๐Ÿ’–

okay bestie, welcome to pam_usertype โ€” it's the Linux-PAM module that does a lil vibe check on what kind of account you're dealing with ๐Ÿ•ต๏ธโ™€๏ธ no cap.


โœจ NAME โœจ

pam_usertype โ€” check if the authenticated user is a system or regular account ๐Ÿ‘‘ (yes that's the whole job, and she does it flawlessly)


๐ŸŒธ SYNOPSIS ๐ŸŒธ

pam_usertype.so [flag...] {condition}

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so like, pam_usertype.so is literally designed to succeed or fail authentication based on the type of the account of the authenticated user. and how does it figure out the type?? with a lil help from the SYS_UID_MAX settings in /etc/login.defs ๐Ÿ’… iykyk.

one super iconic use case: choosing whether to load other modules based on this test. like, gatekeeping but make it productive โœจ

โš ๏ธ bestie listen โ€” the module should be given only one condition as module argument. that's it. one. Authentication will succeed only if the condition is met. periodt.

๐Ÿ’… OPTIONS ๐Ÿ’…

the following flags are supported, and yes they're both lowkey essential:

  • use_uid โ€” evaluate conditions using the account of the user whose UID the application is running under, instead of the user being authenticated. it's giving "who am I really" energy ๐Ÿ™ˆ
  • audit โ€” log unknown users to the system log. snitch mode: activated ๐Ÿ“

๐ŸŽ€ Available conditions are:

  • issystem โ€” succeed if the user is a system user ๐Ÿ’ป
  • isregular โ€” succeed if the user is a regular user ๐Ÿงš

๐ŸŒˆ MODULE TYPES PROVIDED ๐ŸŒˆ

all module types are provided โ€” account, auth, password and session. she's versatile. she contains multitudes. main character energy fr fr ๐Ÿ‘‘


๐Ÿ”ฅ RETURN VALUES ๐Ÿ”ฅ

here's the receipts, bestie:

  • PAM_SUCCESS โ€” the condition was true. slay!! โœ…
  • PAM_BUF_ERR โ€” memory buffer error ๐Ÿ˜ญ
  • PAM_CONV_ERR โ€” the conversation method supplied by the application failed to obtain the username ๐Ÿ—ฃ๏ธโŒ
  • PAM_INCOMPLETE โ€” the conversation method supplied by the application returned PAM_CONV_AGAIN ๐ŸŒ€
  • PAM_AUTH_ERR โ€” the condition was false. not today ๐Ÿ’€
  • PAM_SERVICE_ERR โ€” a service error occurred, or the arguments can't be parsed correctly ๐Ÿซ 
  • PAM_USER_UNKNOWN โ€” user was not found. who?? never heard of her ๐Ÿ™ˆ

๐Ÿ“ EXAMPLES ๐Ÿ“

skip the remaining modules if the user is a system user โ€” the classic:

account sufficient pam_usertype.so issystem

like, if you're a system user you're done here, no further modules, bye bye ๐Ÿ‘‹โœจ


๐Ÿ’œ SEE ALSO ๐Ÿ’œ

login.defs(5), pam(8) โ€” go read those too, bestie, they're the supporting cast ๐Ÿซถ


๐ŸŒธ AUTHOR ๐ŸŒธ

Pavel Bล™ezina <pbrezina@redhat.com> โ€” the icon, the legend, the moment โญ


and that's the whole page!! this one came from the Linux-PAM manual, dated 09/27/2026, and it's literally called PAM_USERTYPE(8). mwah ๐Ÿ’‹ go forth and type-check your users ๐ŸŒˆ๐Ÿ’–

๐Ÿ“ฆ where this page comes from