1
0
Fork 0
forked from pema/sshm
No description
Find a file
2026-06-15 11:04:08 +02:00
LICENSE Add license 2026-06-15 08:57:38 +02:00
README.md Update README.md 2026-06-15 11:04:08 +02:00
win-sshm.py Added support for Windows 11 machines 2026-06-15 11:01:30 +02:00

win-sshm — SSH Connection Manager

A terminal UI and CLI for managing and launching SSH connections, written in a single-file Python 3 script using curses.

TUI License

Features

  • Curses-based TUI with a host list, live filtering, and a detail pane showing user, host, port, identity, tags, notes, and the resulting ssh command
  • Add, edit, and delete hosts from forms inside the TUI
  • Connect to a host with Enter (replaces the process with ssh)
  • Upload your public key to a host with ssh-copy-id, choosing from available keys in ~/.ssh
  • Non-interactive CLI subcommands for scripting (save, connect, list, remove, upload-pubkey)
  • Hosts are stored in a plain pipe-delimited file at ~/.sshm/hosts with 0600/0700 permissions

Requirements

Linux / macOS

  • Python 3 (curses is included in the standard library)
  • ssh
  • ssh-copy-id (for key upload)

Windows

  • Python 3
  • windows-curses for the TUI: pip install windows-curses
  • OpenSSH client (ssh) — enable via Settings → Optional Features → OpenSSH Client (Windows 10/11)
  • ssh-copy-id is not needed on Windows; key upload is handled natively via SSH

Installation

Linux / macOS

chmod +x sshm.py
# Optionally place it on your PATH
sudo ln -s "$(pwd)/sshm.py" /usr/local/bin/sshm

Windows

pip install windows-curses
# Optionally add the directory to your PATH and invoke as: python sshm.py

Usage

TUI

Run with no arguments to launch the interactive TUI:

sshm

Key bindings:

Key Action
/ Navigate hosts
Enter Connect via SSH
a Add a new host
e Edit selected host
d Delete selected host
u Upload public key
/ Search / filter hosts
r Reload host list
q Quit

In forms: Tab/ and move between fields and buttons, Enter activates, Esc cancels.

CLI

sshm                          Launch TUI
sshm save <alias> -h HOST     Save a host (-u user, -p port, -i identity, -t tags, -n notes)
sshm connect <alias>          Connect to a saved host
sshm list [filter]            List saved hosts
sshm remove <alias>           Remove a host
sshm upload-pubkey <alias>    Upload a public key via ssh-copy-id (-k key.pub)

Examples:

sshm save web1 -h 203.0.113.10 -u deploy -p 2222 -i ~/.ssh/id_ed25519 -t "prod,web"
sshm connect web1
sshm list prod
sshm upload-pubkey web1

Storage

Hosts are stored one per line in ~/.sshm/hosts (override with the SSHM_DIR environment variable), in the format:

alias|user|host|port|identity|tags|notes

The directory and file are created automatically. On Linux/macOS restrictive permissions (0700/0600) are applied; on Windows this step is skipped.

License

This project is licensed under the GNU General Public License v3.0.