PHP code example of paulvl / ssh

1. Go to this page and download the library: Download paulvl/ssh 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/ */

    

paulvl / ssh example snippets


/*
create and ssh instance passing:
- server IP
- username
- private key value
- ssh port number
*/
$ssh = new SHH\SSH(
	'your.own.server.ip',
	'username',
	'your-private-key',
	22);

$ssh->canConnect();

$ssh->connect();

$ssh->disconnect();

$ssh->run(['command-1', 'command-2']);