I have a web application running built in PHP using MySQL as database. I'm trying to give specific users access to a Linux system via SSH to perform simple command-line tasks. Since I do already have a database ready filled with usernames/passwords, I would like to use this data for users to sign in. I'm using the PHP function password_verify and in some cases one time passwords, so I am unable to use MySQL directly for authentication.
I would like to write a PHP script to log users in, something like this:
php login.php username password
that simply returns 1 or 0, or maybe home directories, permissions, etc.
I have read a lot about PAM & PHP, but this is about using PAM in PHP, and I want it the other way around. Using a LDAP server for this purpose seems a bit overkill to me. I am unable to find something that I need.
Can someone give me a nudge in the right direction?