degagne/libssh2
最新稳定版本:v1.2.0
Composer 安装命令:
composer require degagne/libssh2
包简介
PHP SSH2 wrapper library
README 文档
README
LibSSH2 implements all supported SSH2 functions from the libssh2 extension.
Requirements
- PHP >= 5.4
- libssh2 Extension
Installation
Add libssh2 package to your composer.json file.
{
"require": {
"degagne/libssh2": "~1.2.1"
}
}
or run
composer require degagne/libssh2
Usage
$configuration = (new Configuration()) ->set_username('username') ->set_password('password') ->set_host('hostname'); $authentication = new Password($configuration); $ssh = new SSH($configuration, $authentication); $ssh->exec('ls -ltr'); $output = $ssh->get_output(); // stdout $errors = $ssh->get_error(); // stderr $retval = $ssh->get_exitstatus(); // return code
With Kerberos:
$kerberos = new Kerberos($configuration, $authentication); $krb_cache = $kerberos->kcreate('principle'); $ssh->exec("export KRBCCNAME={$krb_cache};ls -ltr");
Kerberos requires the use of the KRBCCNAME environmental variable to be set.
统计信息
- 总下载量: 2.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-25