我需要一些认真的帮助。我的服务器被锁定了:一些黑客更改了我的密码。但是,他无法破解 root 帐户。我仍然可以访问,但它没有在 SSH 中启用,所以我需要访问我在 Linux 中的帐户。我只能在我的服务器上访问 HTTP。我想知道是否可以通过 PHP 更改我的密码。
我有问题错误消息“sudo 需要终端”。你能帮我找回密码吗?
<?
$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);
}
?>