$connection = ssh2_connect('0.0.0.0', 22);
ssh2_auth_password($connection, 'root', 'pass');
$stream = ssh2_exec($connection, 'passwd 123321 \n 123321 \n');
stream_set_blocking($stream, true);
$data = '';
while($buffer = fread($stream, 4096)) {
$data .= $buffer;
}
echo $data."<hr/>";
fclose($stream);