1. Go to this page and download the library: Download faraweilyas/sshbunny 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/ */
faraweilyas / sshbunny example snippets
use SSHBunny\SSHBunny;
tput of command executed while ->getData(TRUE) will dispay the output
$sshBunny = (new SSHBunny('local'))
->initialize()
->exec("echo 'Hello World'")
->getData(TRUE);
// Will return the result of executed command output
$sshBunny
->exec("ls -la")
->getData();
// Will display the result of executed command output
$sshBunny
->exec("ls -la")
->getData(TRUE);
// Will clear the first executed command output and return the next executed command output
$sshBunny
->exec("ls -la")
->clearData()
->exec("whoami")
->getData(TRUE);
// Will run the commands provided and display the result then disconnect from the server
$sshBunny
->exec("ls -la", "whoami")
->getData(TRUE)
->disconnect();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.