PAM_SUCCEED_IF(8)
โจ pam_succeed_if ๐ โจ
okay bestie, welcome to PAM_SUCCEED_IF(8), straight outta the Linux-PAM Manual ๐. this one's a lil module that's basically the vibe-check bouncer of PAM โ it peeks at your account's characteristics and goes "yeah you're in" or "no ma'am" ๐ช๐. it's giving gatekeeper, but make it authentication.
๐ธ NAME ๐ธ
pam_succeed_if โ test account characteristics ๐ฆ
โจ SYNOPSIS โจ
pam_succeed_if.so [flag...] [condition...]
๐ DESCRIPTION ๐
so pam_succeed_if.so is literally designed to succeed or fail authentication based on characteristics of the account belonging to the user being authenticated, or values of other PAM items. one super iconic use is selecting whether to load other modules based on this test โ like, it decides who even gets to the party ๐.
the module should be given one or more conditions as module arguments, and authentication will succeed only if all of the conditions are met. all of them. every single one. no skipping, bestie ๐ซถ.
๐ OPTIONS ๐
the following flags are supported:
debugโ turns on debugging messages sent to syslog. so it'll spill the tea to syslog ๐ต.use_uidโ evaluate conditions using the account of the user whose UID the application is running under, instead of the user being authenticated. lowkey a whole different person's account, be aware ๐.quietโ don't log failure or success to the system log. ๐คซquiet_failโ don't log failure to the system log. only the fails get muted, the wins still get posted ๐.quiet_successโ don't log success to the system log. only the wins go silent this time โจ.auditโ log unknown users to the system log. not me snitching on the strangers ๐.
conditions are three words: a field, a test, and a value to test for. so like, field, vibe, expectation. periodt ๐ .
the available fields are user, uid, gid, shell, home, ruser, rhost, tty and service:
field < numberโ field has a value numerically less than number.field <= numberโ field has a value numerically less than or equal to number.field eq numberโ field has a value numerically equal to number.field >= numberโ field has a value numerically greater than or equal to number.field > numberโ field has a value numerically greater than number.field ne numberโ field has a value numerically different from number.field = stringโ field exactly matches the given string. exact. no wiggle room ๐ .field != stringโ field does not match the given string.field =~ globโ field matches the given glob.field !~ globโ field does not match the given glob.field in item:item:...โ field is contained in the list of items separated by colons. ๐field notin item:item:...โ field is not contained in the list of items separated by colons.user ingroup group[:group:....]โ user is in given group(s). bestie is in the group chat โ .user notingroup group[:group:....]โ user is not in given group(s). not in the gc, sorry ๐ซ.user innetgr netgroupโ(user,host)is in given netgroup.user notinnetgr groupโ(user,host)is not in given netgroup.
๐ง MODULE TYPES PROVIDED ๐ง
all module types โ account, auth, password and session โ are provided. all of them. versatile queen ๐.
โญ RETURN VALUES โญ
PAM_SUCCESSโ the condition was true. slay, it passed ๐.PAM_AUTH_ERRโ the condition was false. it's a no from me ๐ญ.PAM_SERVICE_ERRโ a service error occurred, or the arguments can't be parsed correctly. something broke or the args are giving nonsense ๐.
๐ EXAMPLES ๐
to emulate the behaviour of pam_wheel, except there is no fallback to group 0 โ being only approximated by checking also the root group membership:
auth required pam_succeed_if.so quiet user ingroup wheel:root
given that the type matches, only loads the othermodule rule if the UID is over 500. adjust the number after default to skip several rules:
type [default=1 success=ignore] pam_succeed_if.so quiet uid > 500
type required othermodule.so arguments...
๐ฆ SEE ALSO ๐ฆ
๐ AUTHOR ๐
Nalin Dahyabhai <nalin@redhat.com> โ thank you for your service king ๐
and that's the whole page, bestie!! this was Linux-PAM, dated 09/27/2026, and honestly? iconic. go forth and gatekeep responsibly ๐
โจ๐ซถ
๐ฆ 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