CLI to manage SSH aliases (hosts and targets) and run ssh/scp through aliases.
Project description
managed-ssh
managed-ssh (mssh) is a CLI to manage SSH aliases per user and use them with ssh and scp.
It stores aliases in:
~/.mssh/aliases.json
Alias types:
hosts:alias -> hosttargets:alias -> user@hostkeys:alias -> /path/to/private_key(optional)
Install
From this repository:
pip install -e .
After install, the command is:
mssh --help
Quick Start
Generate a key in ~/.mssh/keys:
mssh keygen server-a
Generate a key with passphrase (as argument):
mssh keygen server-a "my-passphrase"
Save aliases:
mssh save-host devbox 10.10.10.5
mssh save-target app ubuntu@10.10.10.9
Or autodetect:
mssh save devbox 10.10.10.5
mssh save app ubuntu@10.10.10.9
Save with a specific key:
mssh save-host devbox 10.10.10.5 --key ~/.ssh/devbox.pem
mssh save-target app ubuntu@10.10.10.9 --key ~/.ssh/app.pem
List aliases:
mssh list
Access via SSH:
mssh access devbox
mssh access root@devbox
mssh access ubuntu@10.10.10.9
Override key for a single access:
mssh access devbox --key ~/.ssh/temporary.pem
Copy with SCP (alias resolution on both remote sides):
mssh copy ./local.txt app:/tmp/local.txt
mssh copy root@devbox:/tmp/file.txt ./file.txt
Override key for a single copy:
mssh copy ./local.txt app:/tmp/local.txt --key ~/.ssh/temporary.pem
Commands
mssh access <destination>mssh keygen <key_name> [passphrase]mssh copy <source> <target>mssh save-host <alias> <host> [--key <path>]mssh save-target <alias> <user@host> [--key <path>]mssh save <alias> <value> [--key <path>]mssh listmssh delete <alias> [-y]mssh rename <old_alias> <new_alias> [-y]mssh set-key <alias> <path>mssh unset-key <alias>mssh export [--file <path>]mssh import --file <path> [--replace | --overwrite | --skip-existing] [-y]
Export / Import
Export current aliases:
mssh export --file backup-mssh.json
Import and merge, skipping existing:
mssh import --file backup-mssh.json --skip-existing -y
Import and merge, overwriting existing:
mssh import --file backup-mssh.json --overwrite -y
Import replacing everything:
mssh import --file backup-mssh.json --replace -y
Notes
- If an alias already exists,
saveasks for confirmation before overwrite. - A name cannot exist at the same time as both
hostandtargetalias. - Keys are used automatically when destination/source uses an alias.
- In
copy, if both sides are remote aliases,msshcan pass both identity files. msshrequiressshandscpbinaries available in your systemPATH.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file managed_ssh-0.1.0.tar.gz.
File metadata
- Download URL: managed_ssh-0.1.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
558166a49d9bbabd7875dbf3c67d4c972dced8fae9ad2cd7314eb895e2ba9599
|
|
| MD5 |
c74f1c8d205515a155f4af49f4173eee
|
|
| BLAKE2b-256 |
ac4d509513d60af9625abd0f1579463eecb4e7e9e35912e4146ee4249f00b911
|
File details
Details for the file managed_ssh-0.1.0-py3-none-any.whl.
File metadata
- Download URL: managed_ssh-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4109aefdfe98080818bce301e5adebcb24c5eabe4d035a120c9fb61f78f6b8cf
|
|
| MD5 |
257af74ae0fe65a2bb071fdb1a8f22e9
|
|
| BLAKE2b-256 |
50636b64a46a62d387e5936f174370ec75e15a8796b21a0f1241ef038dff81b9
|