Command Line Password Check
I have a question for anyone out there who might be familiar with the command line.
I am designing a web application (in PHP) which will get a user's name and password, then change to a new password that the user requests.
However, I've run into a few small snags.
At first, I was going to just attempt to open an ssh session from php using the shell_exec() command (which lets a command line program to be run) and see if the session opens properly. But, as many will be quick to realize, there's no actual way to pass the user's password in a command line statement with ssh.
Then, my next thought was to log in to the local machine through ssh as root, and have a shell script automatically run that would confirm the user really gave me the right password. (I can log into root using a pub/priv key setup) However, I can't seem to find a method for checking whether or not the user gave me the correct password, seems like the applications passwd and chpasswd only let me change the password.
I looked into writing a script that would use "expect", but I don't have access to Tcl on this system, so expect isn't a possibilty.
Anyone have any suggestions?
Thanks a bunch.