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.6.0.tar.gz (15.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.6.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: autossh_cli-1.6.0.tar.gz
  • Upload date:
  • Size: 15.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.6.0.tar.gz
Algorithm Hash digest
SHA256 76681a1ac135209b42cdf5f4bc1e368dbbddbc47928e163eb355aa7bdf97d243
MD5 51e58febb4ba2e0e9dbd8348f96ada63
BLAKE2b-256 63d0039ce5345bfe4a8e09adece535e0dc063f0c1229347a29c2c11288362aed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: autossh_cli-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96067c2ec198f996b27815bff2f571f12f3709b6f66c7cc34f10785a148f0a8c
MD5 b093bf64b5cbab5dc6ba58984b02ee7b
BLAKE2b-256 056c3075520ea3f6043979305c0f219de94735a347b545bdbdf11db6bbf882d4

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