tags:

views:

263

answers:

0

I Need some serious help guys i got locked out from my sever, some hacker change my password however he wasnt able to hack the root account i still have access but its not enabled in ssh so i need access to my account in linux i only have access to http on my server i want to know how possible i can change my password via php. i am having one problem it states sudo requires terminal can you please help me to recover my password.

<?
$command_exec = 'su root -u root mypwd';
$root_pwd = 'msiamd';
$description = array(
    0 => array("pipe","r"),
    1 => array("pipe","w"),
    2 => array("file","error-output", "a"
));
$process = proc_open($command_exec,$description,$pipes);
if(is_resource($process))
{
    fwrite($pipes[0],$root_pwd."\r\n");
    fclose($pipes[0]);
    echo stream_get_contents($pipes[1]);
    print_R($pipes);
    fclose($pipes[1]);
    proc_close($process);
}
?>