PHP code example of moccalotto / ssh-portal

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

    

moccalotto / ssh-portal example snippets




return [
    // here, you define your hosting vendors.
    // currently, DigitalOcean and Hetzner are supported.
    // You can also define hosts "on file" via the OnFile provider.
    'hosts' => [
        [
            'vendor' => 'Hetzner',
            'name' => 'hetz-1',
            'user' => 'api-username-from-hetzner-robot',
            'pass' => 'api-upassword-from-hetzner-robot',
        ],
        [
            'vendor' => 'DigitalOcean',
            'name' => 'digo-1',
            'token' => 'token-from-digo-backoffice',
        ],
        [
            'vendor' => 'Uri',
            'name' => 'from-json-file',
            // uri can be anything support by php stream wrappers
            // see http://php.net/manual/wrappers.php
            'uri' => 'https://www.my-domain.tld/server-list.json',
        ],
        [
            'vendor' => 'OnFile',
            'name' => 'my-own-datacenter',

            // Here you can add all the servers you own/operate
            // that are not located at one of the supported vendors.
            'servers' => [
                [
                    'name' => 'Some Server',
                    'address' => '123.123.123.123',
                    'username' => 'monkey',
                ],
                /* ... */
            ],
        ],
        /* ... */
    ],
];
shell
$  composer global