LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-17-2012, 11:32 AM   #1
128
LQ Newbie
 
Registered: Sep 2012
Posts: 22

Rep: Reputation: 0
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 ??????????
?>
 
Old 11-18-2012, 10:51 PM   #2
128
LQ Newbie
 
Registered: Sep 2012
Posts: 22

Original Poster
Rep: Reputation: 0
Someone???
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble compiling libssh2 tincboy Linux - Software 1 06-18-2010 12:32 PM
libssh2 extension bluepepsi Linux - Server 1 05-22-2010 04:15 AM
problem installing libssh2-0.18 rh-penguin Linux - Software 2 12-31-2007 10:38 AM
libssh2 ver. 0.18 RaduH Linux - General 2 11-29-2007 09:59 AM
Libssh2 version RaduH Linux - Software 3 11-15-2007 12:11 PM


All times are GMT -5. The time now is 07:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration