Skip to content

sgchris/ssh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

SSH Client Class
v 0.2

Checking:
$ php -m | grep ssh

Installing:
$ sudo apt-get install php5-dev php5-cli php-pear build-essential openssl-dev zlib1g-dev libssh2-1-dev
$ sudo pecl install -f ssh2
$ echo 'extension=ssh2.so' > /etc/php5/conf.d/ssh2.ini

Using:
|
|- Connect:
|  __construct([$host = "localhost"[, $login = "root"[, $password = ""[, $port = 22]]]]);
|  | $ssh = new ssh('google.com', 'root', 'password'[, $port = 22]);
|
|- Exec command:
|  
|  | $result = $ssh("ls -la");
|    or
|  | $array_of_result = $ssh(array("ls -la", "uptime"));
|    or
|  | $array_of_result = $ssh("ls -la", "uptime");
|    or
|  | $array_of_result = $ssh(array("echo 1", "echo 2"), "echo 3", array(array("echo 4", "echo 5", "echo 6"), "echo 7"));
|
|- Tunnel:
|  | $f = $ssh->tunnel("10.0.0.100", 1234);
|
|- Download:
|  | $ssh->download("/remote/file", "/local/file");
|
|- Upload:
|  | $ssh->upload("/local/file", "/remote/file"[, $file_mode = 0644]);
|
|- Reconnect:
|  | $ssh->reconnect();
|
|- Disconnect is automatic;

Thx 4 using;

About

ssh2 client for php

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%