Skip to main content

SSH client wrapper for easily connecting to hosts

Project description


SSH client wrapper for easily connecting to hosts

Coverage Status

This wrapper for the well known ssh client makes it possible to connect to the right server with just typing a part of the host name. The external sources are queried using the search term and those matching the string will be presented as an option.

Current supported sources:

  • JSON file
  • MySQL database
  • JSON API endpoint
  • Custom parser class


Install ssht using pip:

pip3 install ssht

or if you want the latest version:

pip3 install


ssht [-h] name [-4] [-6] 

positional arguments:
  name        name of the host to connect to

optional arguments:
  -h, --help  show this help message and exit
  -4          connect using ipv4 (skip dns if ipv4 address is defined)
  -6          connect using ipv6 (skip dns of ipv6 address is defined)

Example of a connection

$ ssht host01
Connect to: 1
Connecting to ""


Create ssht folder in home directory

mkdir ~/.ssht

Configure sources in ~/.ssht:

Define servers in JSON format:

	"hosts": [
		"port": "2222",
		"hostname": "",
		"ipv4": "",
		"user": "root"
		"port": "2222",
		"hostname": "",
		"ipv4": "",

Define servers in MySQL:

  "config": {
    "host": "localhost",
    "user": "username",
    "password": "passeword",
    "database": "infra"
  "query": "SELECT hostname, port, ipv4, ipv6, user FROM servers"

Define JSON API endpoint:

	"config": {
		"url": "",
		"headers": {
			"Authentication": "bla:huk"

Define custom class:

  1. Create a Python package containing your class
from ssht.plugins import Parser, Host

class ExampleParser(Parser):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._files = self.get_files('.custom')

    def search(self, needle):
        return [
            Host(hostname='', ipv4=''),
  1. Enable your class in ~/.ssht/config.json

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssht-1.0.0.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

ssht-1.0.0-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page