zsh plugin that cuts ssh and scp boilerplate
Interactive Host Selection
Browse hosts from .ssh/config with fuzzy search and live preview of connection details, port, key, and descriptions.
Filter and navigate with keyboard.

Quick Host Setup
Press Ctrl+N to add new hosts through guided setup. Behind the scenes the plugin:
- Generates an ed25519/RSA-4096 key (or skips key generation for password-based auth)
- Backs up existing SSH config and keys before any changes
- Appends the host to a ssh config file via
Includedirective, leaving your main config untouched - Adds key to SSH agent
- Deploys the public key to the server via
ssh-copy-id
SCP Support
Upload files/directories with Ctrl+U, download with Ctrl+D. Auto-detects recursive transfers for directories.

Pin
Press Ctrl+P to pin frequently-used hosts to the top of your list. Quick access to servers or most used environments.

Custom Descriptions
Press Ctrl+E to add descriptions to hosts. Document server purpose, environment (prod/staging/dev), or notes.

-
Install
ssh-host:Zinit / Antigen / Znap
Add to your
~/.zshrc:zinit load "obolientsev/ssh-host" # or antigen bundle obolientsev/ssh-host # or znap source "obolientsev/ssh-host"
or
Oh My Zsh
- Clone the repository:
git clone https://github.com/obolientsev/ssh-host ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/ssh-host- Add to your plugins list in
~/.zshrc:
plugins=(ssh-host $plugins)- Restart your shell:
source ~/.zshrc
-
Launch the plugin:
ssh-host
-
Follow the instructions to add your first host.
| Key | Action |
|---|---|
↑/↓ |
Navigate hosts |
Enter |
Connect to selected host |
Ctrl-N |
Add new host |
Ctrl-E |
Edit selected host description |
Ctrl-P |
Toggle pin status of selected host |
Ctrl-U |
Upload file to selected host |
Ctrl-D |
Download file from selected host |
Esc |
Quit |
Adding a new SSH key to your GitHub account
To configure your account on GitHub.com you need add an SSH key to your GitHub account. To generate new SSH key and configure it correctly follow these steps:
- Open
ssh-host→ pressCtrl-N - Fill in the wizard:
- Alias:
github - Hostname:
github.com - User:
git - Port:
22 - Key type:
ed25519
- Alias:
- Confirm setup
- Copy
Public keyfrom response:
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIgiKN9FQcPgCUuA81PSn28ThZQANY0v4pvMTfjZo8Ka github@demo
- Paste into GitHub Settings → SSH keys
For more details GitHub docs
Multiple GitHub accounts (personal + work)
Useful if you contribute to repos with a personal account but push to work repos under a different account. SSH doesn't support multiple identities for the same hostname out of the box — aliases solve this.
- Add SSH key (see tip above) for personal account with alias
github-personal - Add SSH key (see tip above) for work account with alias
github-work - Copy each pubkey to the corresponding GitHub account's SSH keys
- Use the alias in git remotes instead of
github.com:# in work project git remote set-url origin github-work:org/work_repo.git # in personal project git remote set-url origin github-personal:username/repo.git
Multi-alias Host entries
If you use multi-alias Host blocks in your SSH config, the plugin shows each alias as a separate entry:
Host production prod p
HostName example.com
User ubuntu
All three — production, prod, p — appear in the list by default.
To show only the first alias per block, add to your ~/.zshrc:
export SSH_HOST_SHOW_ALL_SUB_ALIAS=falseToo many authentication failures
Issue: SSH server rejects connection after trying too many keys. Happens when ssh-agent has multiple keys loaded and SSH tries them all before the correct one, exceeding server's MaxAuthTries limit (typically 6 attempts).
Fix: Add IdentitiesOnly yes to force SSH to use only specified keys, not all agent keys.
Update config:
Host problematic-host
HostName example.com
User myuser
IdentityFile ...
IdentitiesOnly yes # Add this line
Prevent globally: Add to ~/.ssh/config top:
Host *
IdentitiesOnly yes
Note
This plugin manages SSH configurations in a separate file to avoid conflicts with your existing setup. All generated keys are stored in ~/.ssh/ssh_host/keys/.

