Skip to main content

Auto-SSH toolkits with alias-based host management and password encryption

Project description

autossh

Alias-based SSH/SCP toolkit with encrypted password storage.

Wraps ssh/scp via pexpect so you can connect to any host by name without typing passwords. All passwords are stored AES-256-GCM encrypted in a local hosts file.

Install

pip install autossh

Python 3.8+ required. Runtime dependencies: pexpect, pyyaml, cryptography.

Quick start

# 1. Open the host file editor (creates the file on first run)
aedit

# 2. Add a host line, save and quit vim:
#    192.168.0.1   root   mypassword

# 3. On save, aedit prompts for a master password and encrypts all passwords.
#    The master password can be saved to ~/.config/autossh/.env for future use.

# 4. Connect
assh 192.168.0.1

Commands

Command Description
assh <dest> SSH to host
apush <src> <dest>:<path> Push local file to remote
apull <dest>:<path> <dst> Pull remote file to local
acat [dest] Print hosts file (passwords decrypted)
aedit Edit hosts file (passwords decrypted in editor, re-encrypted on save)
amaster init Encrypt a plaintext hosts file for the first time
amaster Rekey: re-encrypt all passwords with a new master password

Run any command with -h for usage details.

Host file format

Each non-comment line:

host[:port][[alias]]    user    password

Examples:

192.168.0.1             root    password1
192.168.0.2:36000       root    password2    ## custom port
192.168.0.3[dev3]       root    password3    ## with alias
192.168.0.4:22[dev4]    root    password4    ## port + alias
192.168.0.5             None    None         ## anonymous
  • host — IP or hostname
  • port — optional, defaults to 22
  • alias — optional short name for assh <alias>
  • user / password — use None for anonymous SSH

Password encryption

Passwords are encrypted with AES-256-GCM using a master password you choose. The master password is derived into a file key via scrypt and stored in ~/.config/autossh/.env (chmod 0600) so you only type it once per machine.

aedit decrypts passwords in memory (temp file in /dev/shm) so the editor always shows plaintext; the hosts file on disk always stores ciphertext.

Configuration

Optional config at ~/.config/autossh/config.yaml:

timeout: 30       # pexpect timeout in seconds (default: 30)
host_file: ~/.config/autossh/hosts   # override host file 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

autossh_cli-1.7.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

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

autossh_cli-1.7.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file autossh_cli-1.7.0.tar.gz.

File metadata

  • Download URL: autossh_cli-1.7.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for autossh_cli-1.7.0.tar.gz
Algorithm Hash digest
SHA256 28997d3b62c16e206b74bafb8e54a43143b27c58b6f60a166a26dfc0f2fdb1e9
MD5 20c847da569a048a96ad17a6ce2b5b0d
BLAKE2b-256 3e14eb17808fe8ed44fde4d789922207fd0a4e784392c205010805a359744e28

See more details on using hashes here.

File details

Details for the file autossh_cli-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: autossh_cli-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for autossh_cli-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad810e16f88a25e2d1e26790a6a0005e7d8a7b364d77998c99a10e7677ed893e
MD5 327ca1748fee74cc7abfc833bd729b62
BLAKE2b-256 ff01d01f4f1a7b233d96f3bcc593eb037b7c2722b46ed38eb9aa28271ed5a2f8

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