Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSH Multi-Server Management Skill

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.

Workflow (user's view)

  1. /ssh init — self-check dependencies and generate servers.json (with one placeholder block).
  2. Edit servers.json — copy the placeholder block and fill in the real server's alias / host / user / port / password.
  3. /ssh add <alias> — Claude reads the json, writes the ssh config, runs ssh-copy-id to set up passwordless login, verifies, and marks it done.
  4. /ssh <alias> — from then on, run remote commands / transfer files by alias at any time.

You only ever edit servers.json; ~/.ssh/config and ssh-copy-id are handled entirely by the AI, and the password never enters the session.

Commands

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.

File structure

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

Security

  • Viewing the registry always uses jq to project non-sensitive fields; it never prints passwords.
  • The password is fed to sshpass only inside scripts/setup.sh via a temporary file, deleted right after.
  • If the skill directory sits on a mount like fuseblk where chmod has no effect, you can export SERVERS_FILE=~/.ssh/servers.json to point it at your home (ext4) and then chmod 600.

Dependencies

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 ""

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages