A lightweight, zero-dependency Bash tool to manage SSH connections with aliases.
Stop memorizing hosts, usernames and ports.
Store every server under a short alias and connect with a single command.
conn is a single-file Bash script that wraps ssh with a human-friendly interface. It stores your server definitions in ~/.ssh_connections.conf and exposes a clean CLI to add, list, edit, connect to, and remove them — plus SSH key management, ProxyJump/IdentityFile, shell completion, and auto-update.
conn to production # SSH into "production" in one shot
conn list # Pretty-printed table of all servers
conn add # Interactive wizard
conn add prod deploy@host:22 --folder /var/www # One-shot add
conn update # Pull the latest version from GitHubcurl -fsSL https://conn.web.ap.it/setup.sh | bashDownloads and installs conn to /usr/local/bin
# bash
conn completion bash
# zsh
conn completion zshThe command adds an idempotent loader to the shell configuration file. Open a new terminal or run the source command it prints. Use conn completion zsh --print (or bash --print) only when you need the raw completion script.
| Command | Description |
|---|---|
conn add |
Interactive wizard to save a new connection |
conn add <alias> <user@host[:port]> [options] |
One-shot add (--folder, --identity, --jump, --password) |
conn list |
Print all connections in a formatted table |
conn info <alias> |
Show details for a connection (password never printed) |
conn to <alias> |
Open an SSH session by alias |
conn edit <alias> |
Modify an existing connection |
conn remove <alias> |
Delete a connection (with confirmation) |
conn reset <alias> |
Remove stale host keys (ssh-keygen -R) |
conn key <action> |
Manage SSH keys — public, private, create [--rsa] |
conn update |
Self-update from GitHub |
conn completion [bash|zsh] |
Install idempotent shell completion |
conn help |
Print usage reference |
Interactive:
conn addType alias: production
Type user (default: root): deploy
Type host: prod.example.com
Type port (default: 22): 22
Password (optional — stored in secret store, copied to clipboard on connect):
Type remote folder (optional): /var/www/myapp
Identity file (optional, e.g. ~/.ssh/id_ed25519):
ProxyJump host (optional): bastion
One-shot:
conn add production deploy@prod.example.com:22 \
--folder /var/www/myapp \
--identity ~/.ssh/id_ed25519 \
--jump bastionconn listNotes column:
- 🔑 saved password (in OS secret store)
- 📂 remote folder
- 🔐 custom identity file
- ↪ ProxyJump
conn to productionBefore opening the SSH session, conn will:
- Verify that an SSH key pair exists (
id_ed25519,id_ecdsa, orid_rsa) - Check for available script updates at most once every 24 hours
- Copy the saved password to the clipboard (if one is stored)
- Hand off to
sshwith optional-i/-J, and auto-cdinto the remote folder
conn key public # Print your public key
conn key create # Generate a new ed25519 key pair (passphrase prompted)
conn key create --rsa # Generate a 4096-bit RSA key pair instead
conn key private # Print your private key (requires typing YES)Useful when you get a "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED" error:
conn reset myserverConnections are persisted in:
~/.ssh_connections.conf
Format (7 fields):
alias|user|host|port|folder|identity|proxyjump
Passwords are not stored in this file. They go to, in order of preference:
- macOS Keychain (
security) - libsecret (
secret-tool) - pass (password-store)
- Fallback file
~/.ssh_connections.secrets(chmod 600)
- macOS: native support for Keychain and
pbcopy. - Linux: native support for
secret-tool/passandxclip,xsel, orwl-copy. - Windows: not supported natively.
connmay run in WSL or Git Bash, but it does not currently integrate with Windows Credential Manager orclip.exe; the fallback secret file should therefore be treated with extra care.
Existing configs in the old alias|user|host|port|password|folder format are migrated automatically on first run — passwords are moved into the secret store and removed from the connections file.
Fields must not contain |.
- macOS or any Unix-like system
- Bash 3.2+ (macOS system Bash is fine)
- OpenSSH client
- Clipboard support —
pbcopyon macOS;xclip,xsel, orwl-copyon Linux - Windows is supported only through WSL or Git Bash, with the limitations above
Remove the binary:
sudo rm /usr/local/bin/connRemove saved connections and secrets:
rm -f ~/.ssh_connections.conf ~/.ssh_connections.secrets
# macOS Keychain entries use service "conn.web.ap.it" — delete from Keychain Access if neededOnce you've connected to your servers with conn, deploy your Laravel apps with cipi.sh — an open-source CLI built exclusively for Laravel. One command installs a complete production stack on any Ubuntu VPS: PHP-FPM, MariaDB, Nginx, Let's Encrypt SSL, zero-downtime deploys.
- Website: conn.web.ap.it
- Repository: github.com/andreapollastri/conn
Pull requests are welcome. For significant changes, please open an issue first to discuss what you'd like to change.
MIT — free to use, modify and distribute.
Made with care by Andrea Pollastri