English | 中文
A skill that lets Claude manage multiple SSH servers for you: connection details live in a single local servers.json, adding a server automatically writes ~/.ssh/config and sets up passwordless login, and from then on you connect by alias only. Passwords are stored only in a local file and never enter the conversation.
The entry point SKILL.md is deliberately lean (action-first: /ssh <alias> resolves the alias and runs ssh directly, no pre-checks); the detailed init/add/delete/list flows are split into references/ and loaded on demand only when needed.
/ssh init— self-check dependencies and generateservers.json(with one placeholder block).- Edit
servers.json— copy the placeholder block and fill in the real server'salias / host / user / port / password. /ssh add <alias>— Claude reads the json, writes the ssh config, runsssh-copy-idto set up passwordless login, verifies, and marks it done./ssh <alias>— from then on, run remote commands / transfer files by alias at any time.
You only ever edit
servers.json;~/.ssh/configandssh-copy-idare handled entirely by the AI, and the password never enters the session.
| Command | What it does |
|---|---|
/ssh init |
Self-check dependencies + initialize servers.json |
/ssh add [<alias>] |
Write the server from the json into the ssh config and set up passwordless login; without an alias it lists unconfigured entries |
/ssh delete <alias> |
Remove a server: clears the json entry + ssh config Host block + the public key in the server's authorized_keys (destructive, asks first) |
/ssh list |
Show registry status (no passwords) |
/ssh <alias> |
Connect to / operate on that server (run commands, scp, read logs, deploy…) |
/ssh |
Usage menu + total count |
When an alias doesn't exist, the skill says "you may have mistyped it, or need /ssh add" and lists the currently available aliases.
ssh/
├── SKILL.md # Lean entry: action-first normal flow + dispatch table
├── README.md # This file (English)
├── README.zh.md # Chinese version
├── servers.json # Server registry (you maintain it; contains passwords, do NOT commit)
├── scripts/ # The actual execution logic (called by the AI; passwords stay inside the scripts only)
│ ├── check-deps.sh # Dependency self-check for /ssh init
│ ├── setup.sh # /ssh add: write config + ssh-copy-id + verify
│ └── delete.sh # /ssh delete: clear authorized_keys / config / json
└── references/ # Detailed flows loaded on demand (only read for specific subcommands or problems)
├── setup.md # init + add + dependencies
├── manage.md # delete + list + alias-not-found
└── usage.md # Everyday ssh operation reference
- Viewing the registry always uses
jqto project non-sensitive fields; it never prints passwords. - The password is fed to
sshpassonly insidescripts/setup.shvia a temporary file, deleted right after. - If the skill directory sits on a mount like
fuseblkwherechmodhas no effect, you canexport SERVERS_FILE=~/.ssh/servers.jsonto point it at your home (ext4) and thenchmod 600.
ssh, ssh-copy-id, sshpass, jq, and the default key ~/.ssh/id_ed25519. /ssh init self-checks them; install whatever's missing:
sudo apt install openssh-client sshpass jq
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N ""