If I have a username and password pair how can I verify that they are actually correct in a Linux system? I know I can use passwd to do so but I want to do it programatically using C.
I should not require root privileges (so reading the shadow file is not an option).
Thank you.
This is a simple example to check the password with some python code. No root privilegs are needed.