How to check if the username and password are valid?

azio

Registered
Aug 8, 2012
1
0
1
cPanel Access Level
Root Administrator
Hi,

I'm wondering if there's a shell command the check whether the provided username and password are valid or not.

What I'm trying to do is logging in the user into my control panel only is he has a valid and active cPanel account on the server.

Your help would be appreciated.
 

charsleysa

Active Member
Jul 18, 2011
41
0
56
Palmerston North, New Zealand
cPanel Access Level
Root Administrator
If writing your script in PHP you can use the cryptography functions to encrypt the password with the currently encrypted password in the shadow file as the salt, if the new encrypted password equals the old encrypted password then the password is correct otherwise it's incorrect.