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 ๐Ÿฆ‹

glob(7), pam(8)


๐ŸŽ€ 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