i need a way to, given a username and plaintext password, authenticate it against existing user accounts on a debian server...and I need to do this from within a perl script (or a system command).
see, the script (for an external interface) will prompt someone for a user/pass, check if its valid, and act on the result accordingly. i don't want to roll my own method of reading /etc/shadow and checking encrypted passwords, because
- it seems dangerous and
- requires root permissions.
i'd prefer some kind of system command or external utility. 'su' wont work (it has to be run from a terminal according to the error msg), and PAM seems overkill since i only need to check the validity of a password, not run any commands under the given username.
i've looked but to no avail, probably because im not totally sure what to look
for. i'd appreciate any help or advice anyone could provide me.