Skip to main content

Python SSH Connection Helper

Project description

pysch - Python-made SSH Connection Manager

pysch (spelled in Russian as пыщ, just for fun), Python-made SSH Connection Helper, is an SSH Client based on paramiko for Mac and Linux. It uses keepass to securely store remote hosts credentials and YAML to maintain inventory tree. It also supports session logging to a file.

Installation

Just use pip to install pysch:

python -m venv venv
cd venv
source bin/activate
pip3 install pysch

Usage

Here is the avaiable commands:

(venv) % pysch
Usage: pysch [OPTIONS] COMMAND [ARGS]...

Options:
  -c, --config PATH               Path to configuration file
  -l, --loglevel [CRITICAL|ERROR|WARNING|INFO|DEBUG]
  --help                          Show this message and exit.

Commands:
  add-credentials   Add new credendials
  connect           Connect to the host
  init              Create initial config and inventoty
  list-credentials  Get list of credendials
  list-hosts        Get list of hosts

First, init the configuration. That creates sample configuration and inventory files with empty keepass file protected with key in ~/.config/pysch/ directory:

(venv) % pysch init
Default configuration has been saved at ~/.config/pysch/

Then add your hosts to the ~/.config/pysch/inventory.yaml using the text editor of your choise and credentials for it using any keepass software or the add-credentials command:

(venv) % pysch add-credentials  
Title: my_credentials
Username: root      
Password: 
Repeat for confirmation: 
"my_credentials" entry has been added to the keepass db

Use --help to show arguments and available options for a command:

(venv) % pysch connect --help
Usage: pysch connect [OPTIONS] HOST

  Connect to the host

Options:
  --session-log PATH  Session log file location
  --help              Show this message and exit.

Connection process is pretty simple:

(venv) % pysch connect srv
Connecting to srv
root@my-shiny-server.example.com:~# 

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

pysch-0.1.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysch-0.1.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file pysch-0.1.0.tar.gz.

File metadata

  • Download URL: pysch-0.1.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pysch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2963bd4c188a6b16a8818e3d55fd181da3212f782c4d2b3ac44a24509b1718ed
MD5 5571f20999ceace9af7617ccfacda0f4
BLAKE2b-256 8f38a2d26d8bd8b1055640ebbd372071d87424b9f977009896111f680b87bc19

See more details on using hashes here.

File details

Details for the file pysch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pysch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pysch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0141ed146bc54984aaf0d00389e4e3f3a62da959b8e15f53569daf9bd641fe24
MD5 ebff3e088d32b6ebb2a8d9b256313ed4
BLAKE2b-256 bbe37c5d133bbe9931289463ae45c4085eaf20bb6a08c8556c6801ff7019b3a4

See more details on using hashes here.

Supported by

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