Re: Php Secure Shell2 (ssh2) Unable to request command execution on remote host
- From: Varlamov Konstantyn <konstantyn17@xxxxxxxxx>
- Date: Fri, 06 Jul 2007 00:03:20 +0300
<?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\n");
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
Re:
The remote server is not a computer, it`s Dlink DES-3526 Ethernet Switch.
Command "show log" is valid comand for him.
Connection and login works but command executing triggers error.
.
- Follow-Ups:
- Re: Php Secure Shell2 (ssh2) Unable to request command execution on remote host
- From: Charles Polisher
- Re: Php Secure Shell2 (ssh2) Unable to request command execution on remote host
- References:
- Php Secure Shell2 (ssh2) Unable to request command execution on remote host
- From: Varlamov Konstantyn
- Re: Php Secure Shell2 (ssh2) Unable to request command execution on remote host
- From: Charles Polisher
- Php Secure Shell2 (ssh2) Unable to request command execution on remote host
- Prev by Date: Launching an application: Does PHP limit network connections?
- Next by Date: Re: Output differs between browser and console
- Previous by thread: Re: Php Secure Shell2 (ssh2) Unable to request command execution on remote host
- Next by thread: Re: Php Secure Shell2 (ssh2) Unable to request command execution on remote host
- Index(es):
Relevant Pages
|