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



<?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.


.



Relevant Pages

  • RE: RDC through VPN - Beginner Questions
    ... Connection to my PC. ... I elected to have my home printer connected in the RDC session, ... When I connect to the remote PC I have to login. ... Is there a way to supress the warning that shows when I start the remote ...
    (microsoft.public.windowsxp.work_remotely)
  • Re: Php Secure Shell2 (ssh2) Unable to request command execution on remote host
    ... $connection) { ... else echo "connect OK"; ... else echo "login OK"; ... Warning: ssh2_exec: Unable to request command execution on remote host ...
    (comp.lang.php)
  • ISDN ppp 128K
    ... set authname optima # Replace these with your login name & password. ... Warning: ipv4_Input: IPCP not open - packet dropped ... set mrru 1500 ... set mru 1504 ...
    (freebsd-questions)
  • Re: [Full-disclosure] Packet sniffing help needed
    ... > Comp1= Windows xp box, Connected via dial up to a free ISP ... accessed a standard POP3 or FTP server over an insecure connection (i.e. ... The attacker doesn't really have to do anything ... But if the user dismisses this warning without ...
    (Full-Disclosure)
  • Problem compiling
    ... echo '> ... cgi.c:148: warning: function declaration isn't a prototype ...
    (Debian-User)