pam_succeed_if - test account characteristics
pam_succeed_if.so [flag...] [condition...]
pam_succeed_if.so is designed to succeed or fail authentication based on characteristics of the account belonging to the user being authenticated. One use is to select whether to load other modules based on this test.
The module should be given one or more conditions as module arguments, and authentication will succeed only if all of the conditions are met.
The following flags are supported:
debugTurns on debugging messages sent to syslog.
use_uidEvaluate conditions using the account of the user whose UID the application is running under instead of the user being authenticated.
quietDont log failure or success to the system log.
quiet_failDont log failure to the system log.
quiet_successDont log success to the system log.
auditLog unknown users to the system log.
Conditions are three words: a field, a test, and a value to test for.
Available fields are user, uid, gid, shell, home and service:
field < numberField has a value numerically less than number.
field <= numberField has a value numerically less than or equal to number.
field eq numberField has a value numerically equal to number.
field >= numberField has a value numerically greater than or equal to number.
field > numberField has a value numerically greater than number.
field ne numberField has a value numerically different from number.
field = stringField exactly matches the given string.
field != stringField does not match the given string.
field =~ globField matches the given glob.
field !~ globField 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 groupUser is in given group.
user notingroup groupUser is not in given group.
user innetgr netgroup(user,host) is in given netgroup.
user notinnetgr group(user,host) is not in given netgroup.
All module types (account, auth, password and session) are provided.
PAM_SUCCESSThe condition was true.
PAM_AUTH_ERRThe condition was false.
PAM_SERVICE_ERRA service error occurred or the arguments cant be parsed correctly.
To emulate the behaviour of pam_wheel, except there is no fallback to group 0:
auth required pam_succeed_if.so quiet user ingroup wheel
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...
Nalin Dahyabhai <email@example.com>