Выполнение команды по ssh2

<?php
if (!function_exists ("ssh2_connect")) {
    die ("function ssh2_connect doesn't exist");
}
 
if(!($con = ssh2_connect("localhost", 22))){
    die("unable to establish connection");
}
 
// авторизуемся по имени пользователя и паролю
if(!ssh2_auth_password($con, "root", "password")) {
    die("unable to authenticate");
}
 
// выполняем комманду
if (!($stream = ssh2_exec($con, "ln -s" ))) {
    die("unable to execute command");
}
 
// collect returning data from command
stream_set_blocking ($stream, true);
$data = "";
while ($buf = fread ($stream,4096)) {
    $data .= $buf;
}
fclose ($stream);
echo $data;
?>