I am trying implement a php script for multiple clients that requires the use of their cpanel/linux username and password. To avoid having to set it up individually of each customer I would like to be able to atomically set the 3 vars that are required, username and password. Username have done as follows
$user = exec('whoami');
Is there any way to retrieve that password also?
Thank
No, there is no way to retrive an linux users password in plain text.
Cpanel has an API. Use that to login your users instead.
That would be a major security flaw! You can never retrieve a users password, you can only change it if you have root permissions. Passwords in linux are encrypted in a one-way fashion. Ie you can go from plain text to hash, but you can never go back from has to plain text.