I have program written in C. It takes 2 arguments username/password and try to authenticate this user using PAM. It works fine when I’m root. When I’m ‘normal’ user, it works for this user, but not for another one. I think, it’s due to using shadow passwords..
As service I’m using:
retval = pam_start("test", username, &local_conversation, &local_auth_handle);
I add this to the /etc/pam.d/test
#%PAM-1.0
auth required pam_unix.so shadow nullok
account required pam_unix.so
session required pam_unix.so
Could you help me, please?
Thanks a lot!
The application needed to be able to read
/etc/shadow.See my post for one way to do this.
EDIT:
Add post from above link in case the link ever breaks