1. Go to this page and download the library: Download phizzl/php-ssh2-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phizzl / php-ssh2-client example snippets
$auth = new PasswordAuthentication("vagrant", "vagrant");
$auth = new PublicKeyAuthentication("vagrant", "/path/to/id_rsa.pub", "/path/to/id_rsa", "keypassword");
$auth = new NoneAuthentication("vagrant");
$auth = new PasswordAuthentication("vagrant", "vagrant");
$session = new SshSession("localhost", 22, $auth);
$auth = new PasswordAuthentication("vagrant", "vagrant");
$session = new SshSession("localhost", 22, $auth);
$sshClient = new SshClient($session);