LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   libssh2 script (http://www.linuxquestions.org/questions/programming-9/libssh2-script-4175437590/)

128 11-17-2012 12:32 PM

libssh2 script
 
How do call php script command with libssh2 [Ctrl]+[C] ?

PHP Code:

<?php
$server
['ip'] = "127.0.0.1";
$server['sshport'] = 22;
$server['user'] = "root";
$server['pw'] = "password";
$command $_GET['command'];
$time $_GET['time'];
if(
$ssh ssh2_connect($server['ip'], $server['sshport'])) {
    if(
ssh2_auth_password($ssh$server['user'], $server['pw'])) {
        
$stream ssh2_exec($ssh$command); 
}else {
         echo 
"Error: Could not connect to the selected server, incorrect username or password..";
     }
}else {
         echo 
"Error: Could not connect to the selected server, SSH server IP or port wrong..";
}

sleep($time);
CONTROL ??????????
?>


128 11-18-2012 11:51 PM

Someone???


All times are GMT -5. The time now is 12:41 AM.