承接 sevencoder/ssh-connect 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sevencoder/ssh-connect

最新稳定版本:v0.0.1-alpha

Composer 安装命令:

composer require sevencoder/ssh-connect

包简介

SSH Connection lib

README 文档

README

Simple manager of connections SSH with PHP using lib SSH2

INSTALATION

To install this dependency, execute the comment below.

composer require sevencoder/ssh-connect 

Utilization

To use the this lib, follow the example below

<?php

require __DIR__.'/vendor/autoload.php';

//Dependency
use SevenCoder\SecureShell\SSH;

//Instance
$connectionSSH = new SSH;

$host = '127.0.0.1';
$port = '2222';

//Connection
if(!$connectionSSH->connect($host, $port)) {
    die('Conection Fail');
}

//Authentication with user && password
if($connectionSSH->authPassword('user','password')) {
    die('Athentication Fail');
}

//Authentication with pair keys
if($connectionSSH->authPublicKeyFile('user', 'id_rsa.pub', 'id_rsa.pem')) {
    die('Athentication Fail');    
}

//Execute Comands
$stdIo = $connectionSSH->exec('ls -l', $stdErr);
echo "STDERR:\n".$stdErr;
echo "STDIO:\n".$stdIo;

Requirements

  • PHP 7.0
  • lib SSH2

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-15