Sudo for PAM authenticated users

radiatejava <[email protected]> Wed, 2 Oct 2019 22:20:20 -0700
Newsgroups gmane.linux.pam
Message-ID <CABJk5k=-Z1B21KTm_6Z2uCEnxRk74koeXc9DQwSK7B-SSyWcYQ@mail.gmail.com>
Hi PAM team
I have a requirement - I authenticate users that do not exist in
/etc/passwd via PAM module where I set the unix_user_id, PAM_USER etc.
While the PAM_USER value coming from PAM module is just a dummy
username coming from my pam module and it is added in /etc/passwd to
have a shell for the user, unix_user_id is not available in
/etc/passwd.

This appear to work fine as far as starting the shell is concerned, I
am not able to do any sudo calls. It gives me the error:

sudo: PAM account management error: Authentication service cannot
retrieve authentication info

So looks like basically, it is trying to fetch the user info for the
userid that does not exist. How can I support this? How can I do sudo
for users authenticated via pam and not existing in /etc/passwd ?