【文件属性】:
文件名称:ssh:PHP 中的简单 SSH 客户端
文件大小:8KB
文件格式:ZIP
更新时间:2021-07-20 11:20:52
PHP
PHP 中的简单 SSH 客户端
具有简单用户和密码身份验证的 SSH 连接
<?php
use Neto\net\ssh\SSHConnection;
use Neto\net\ssh\auth\SSHPasswordAuthentication;
$ssh = new SSHConnection();
$ssh->open('127.0.0.1');
$ssh->authenticate(
new SSHPasswordAuthentication('user', 'password'));
$directoryIterator = $ssh->getDirectoryIterator('/var/www');
while ($directoryIterator->valid()) {
$splFileInfo = $directoryIterator->curren