I have a Linux system with a user named service. I'm using the pam_succeed_if.so module to match this username. For example:
auth required pam_succeed_if.so user = service But it won't match a username of service, apparently because it is also a field accepted by pam_succeed_if.so. From the man page (edited for emphasis):
Available fields are user, uid, gid, shell, home, ruser, rhost, tty and service
How do you escape values that match field names?
Further Troubleshooting:
I turned the debug option on for pam_succeed_if.so, and it's converting the username service to login:
login: pam_succeed_if(login:auth): 'user' resolves to 'login' And this just so happens to be the PAM config for login, /etc/pam.d/login.