How to verify correct username and password
Posted on 2004-09-02
I need some direction for writing a security routine. The idea is that a new security program will run prompting the user for a username/password. The program will verify the password with the user's existing account. If it is a good match, we will continue and run the requested application, otherwise, it will notify the user, ect.
The platform will be red hat. I am hoping that the code to check the user's username/password can be written as a standalone c program or a shell/perl script. Something like:
checkpassword username password
Where I can check the return status and act accordingly
I have been asked to support verifying the password with two configurations:
1) the user account on the local redhat server
2) a user account in a specified active directory,
depending on the customer's preference.
I have found some references to using apache's htaccess command and some references to using PAM modules, but I am hoping the forum here can find a workable solution.