2017 © Pedro Peláez
 

library ssh-portal

CLI program for easy SSH connect to servers

image

moccalotto/ssh-portal

CLI program for easy SSH connect to servers

  • Wednesday, November 15, 2017
  • by moccalotto
  • Repository
  • 2 Watchers
  • 1 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 17 % Grown

The README.md

ssh-portal

Fast and easy way to connect to one of your servers., (*1)

ssh-portal makes it easy to keep a catalogue of all your servers and quickly connect to them., (*2)

Installation

Requirements: make sure that you have composer installed., (*3)

We assume that you have a global compoaser installation, and that ~/.composer/vendor/bin is in your PATH variable. This is not a requirement, but it will make things a lot easier., (*4)

First, install the program., (*5)

$  composer global require moccalotto/ssh-portal

Then configure it:, (*6)

$  ssh-portal portal:reset-config

This creates a config file here: ~/.ssh-portal.config.php, (*7)

Open this and add your servers in the config like so:, (*8)

<?php

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',
                ],
                /* ... */
            ],
        ],
        /* ... */
    ],
];

Usage

See all the available commands here:, (*9)

$  ssh-portal list

See all your servers here., (*10)

$  ssh-portal server:list

Now it's time to play around., (*11)

How do I access the servers?

It would be a good idea to use an SSH key that is authorized on your servers. Otherwise, you will be prompted for a password whenever you try to connect. You can use the ssh-portal ssh:copy-id command to install your ssh key on the remote host., (*12)

Currently, we assume that you connect as root to all servers fetched from Hetzner and Digital Ocean., (*13)

If you need to use a different username, then, for now, you'd have to hardcode the server info in the OnFile provider., (*14)

The Versions

15/11 2017

dev-master

9999999-dev

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner

15/11 2017

0.4.0

0.4.0.0

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner

15/11 2017

0.3.0

0.3.0.0

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner

26/04 2017

0.2.0

0.2.0.0

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner

25/04 2016

0.1.7

0.1.7.0

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner

23/04 2016

0.1.6

0.1.6.0

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner

21/04 2016

0.1.5

0.1.5.0

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner

21/04 2016

0.1.4

0.1.4.0

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner

21/04 2016

0.1.3

0.1.3.0

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner

20/04 2016

0.1.2

0.1.2.0

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner

20/04 2016

0.1.1

0.1.1.0

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner

20/04 2016

0.1.0

0.1.0.0

CLI program for easy SSH connect to servers

  Sources   Download

MIT

The Requires

 

server cli ssh digitalocean hetzner