Skip to main content

A Simple SSH Manager for your terminal written in Python.

Project description

Simple SSH Manager (SSM)

SSM is a lightweight Python ncurses based SSH manager.

Requirements

OS: Windows, Linux, MacOS Python: Python version >=3 Terminal: Putty installed and callable from CLI.(Default, can be changed.)

Startup

  1. Install the dependencies: pip install appdirs>=1.4.4 python-decouple>=3.6 requests>=2.25.1 urllib3>=1.26.5 if on Windows include windows-curses.
  2. To install run: pip install ssmanager
  3. Type ssm in a new terminal to start the app.

Interpreting from source(Optional)

Installation

For installation, you essentially just need to clone the repository and define a few variables.

  1. Clone the repo into a directory of your choosing.
    git clone https://github.com/Lonestar137/ssm.git

  2. Download the python dependencies: curses(ncurses), python-decouple.
    Windows Example: pip3 install -r requirements.txt
    or just pip install for Windows/Other distros. NOTE: For Windows, you will need to run pip install windows-curses instead.

    Install a supported SSH terminal handler for your OS:

    Ubuntu(Linux)
    Make sure you have gnome-terminal, putty, or xterm installed.
    sudo apt install putty or xterm gnome-terminal should be installed by default on standard Ubuntu/GNOME based distros.

    Defining which terminal to use is covered lower in the file, there are a variety to select from.

    Windows
    Download putty. Make sure that putty is callable from the command line, meaning the putty.exe is on the system PATH.

By default SSH_USER and SSH_PASS will be used on all sessions unless you specify a different variable in the hosts.csv username and password fields.
You can define unique username and password for each host if you wish, otherwise SSH_USER and SSH_PASS will be used on that host.

  1. Afterward, you can start the application from that directory by typing in a terminal: python3 ssm/main.py

Configuration

Location of configuration files can be found by typing ? in the application.
There are two files to take into account. The .env file which contains session passwords and configuration options and the hosts.csv.
The hosts.csv file is your database of session information. You can manually edit either file if preferred, or use the built in functionality to automatically edit the files.

Support for ssh-keys

Support for SSH_KEYS can be enabled on a host by setting the ssh_key column value = to True and the path to the key equal to the password column variable.

Example manually creating a host:

Inside Hosts.csv: HostFolder,10.1.1.1,MYUSER,MYKEYFILE,True Inside .env: MYUSER=genericUser123 Inside .env: MYKEYFILE=path/to/keyfile.pem

The advantage is that hosts.csv can easily be distributed to other systems, user/password columns merely reference a variable in .env so there is no risk of accidentally exposing sensitive information as long as the .env file is not also shared.

Defining a different port

Note: currently, all terminals support variable port assignment EXCEPT Putty.

To use a different port simply define it in your hosts.csv like so: Home,10.1.1.1:9999

Changing the SSH terminal

By default, putty is used for Windows and Unix-like systemds.
In the .env file, set PLATFORM equal to one of the supported SSH terminals. For example: PLATFORM=putty-windows or PLATFORM=gnome-terminal
Options: putty-linux, putty-windows, gnome-terminal, xterm-terminal

Keybinds

You can see a list of keybinds if you press ? from the main SSM menus.
j, k - down, up J, K - down+5, up+5 d - On a host to delete it. Note that deleting a host does not delete the password variable stored in .env.
p - Ping the host.
l - Open a shell to the selected host.
/ - Search the hosts using regex.

Troubleshooting

  1. _curses not found.
    This is a Windows issue where the Python curses module uses a different package name. You simply need to run pip install windows-curses

  2. putty.exe not found.
    You need to make sure that putty was installed correctly. The putty.exe needs to be stored in a location on your systems PATH. To see currently avail folders type: echo $PATH. Putty should be stored in one of those folders or added to the PATH.

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

ssmanager-0.8.11.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

ssmanager-0.8.11-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file ssmanager-0.8.11.tar.gz.

File metadata

  • Download URL: ssmanager-0.8.11.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for ssmanager-0.8.11.tar.gz
Algorithm Hash digest
SHA256 50a31dcd1df4d7018eb1b0c078ff4e5618cdc73c1021ef215e41fa4624a8a7f1
MD5 fa5b051ec98da343dd46caf2d49dec5c
BLAKE2b-256 e87c048b11638da41782364115512792ce653f49fbf96d030b36867d95451a65

See more details on using hashes here.

File details

Details for the file ssmanager-0.8.11-py3-none-any.whl.

File metadata

  • Download URL: ssmanager-0.8.11-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for ssmanager-0.8.11-py3-none-any.whl
Algorithm Hash digest
SHA256 2db355c4c50f5306041e151d2f241175af74a9390950ea9866ea5d2f266169a1
MD5 50b5beebf7981ae573e789b70dc8c463
BLAKE2b-256 e683b79d6888f8e46adad51cb19239ecf9770e93e88d393bc407b3e6c5767473

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