Re: Php Secure Shell2 (ssh2) Unable to request command execution on remote host



Tis is not work to
<?php


$connection = ssh2_connect("login", 22);

if (! $connection) {
die("Connection failed.");
}
else echo "connect OK";



if (! ssh2_auth_password($connection,"user","test")) {
die("Auth failed.");
}
else echo "login OK";
sleep(10);


$stream=ssh2_exec($connection,"show log");
stream_set_blocking($stream, true);
$output = stream_get_contents($stream);

?>

connect OKlogin OK
Warning: ssh2_exec(): Unable to request command execution on remote host in /home/konstantyn/www/php/test.php5 on line 22

Warning: stream_set_blocking(): supplied argument is not a valid stream resource in /home/konstantyn/www/php/test.php5 on line 25

Warning: stream_get_contents() expects parameter 1 to be resource, boolean given in /home/konstantyn/www/php/test.php5 on line 26
.



Relevant Pages

  • Problem compiling
    ... echo '> ... cgi.c:148: warning: function declaration isn't a prototype ...
    (Debian-User)
  • Re: array_search troubles
    ... The warning states: ... Boolean value which evaluates to FALSE, ... echo "Match found\n"; ...
    (comp.lang.php)
  • Re: fopen on an URL with parameters
    ... I tried echo ... What version of PHP do you have? ... think the warning is because the returned result ... but that the problem lies in the specification of the URL. ...
    (comp.lang.php)
  • Re: Shell script with weird output.
    ... >>I don't want the message's backslashes read as escape characters! ... >>for the warning. ... > extra spaces. ... echo "$line" ## right ...
    (comp.unix.questions)
  • CoyoteLinux oddness
    ... When pinging from an ... internal box I got a warning in the echo about the response not being a ...
    (comp.os.linux.security)