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
2021-07-20 15:03:43
8KB
PHP
1