
ssh-vps-skill
给 AI agent(Claude Code / openclaw / Codex)用的 VPS SSH 管理技能:统一密钥、别名管理、一键下发公钥、安全关闭密码登录、批量探活
Install with your AI
Paste into Claude Code, Cursor, or any agent — it reads the repo and wires the tool into your project.
Install and set up ssh-vps-skill (claude-skill project) into my current project. Found on https://claudeers.com/ssh-vps-skill Repo: https://github.com/xiao-vvv/ssh-vps-skill Homepage/docs: — Detected install method: claude-skill → # copy this skill into .claude/skills/ssh-vps-skill/ Category: devops. Platforms: cli. Read the repo's README for exact setup and env vars, then install it and wire it into my project. Claudeers Health Verdict: slowing; community-verified: false. Confirm the source before running anything.
# copy the skill dir into your project: # .claude/skills/ssh-vps-skill/ (or ~/.claude/skills/ssh-vps-skill/ for all projects)
git clone https://github.com/xiao-vvv/ssh-vps-skill
// compatibility
| Platforms | cli |
|---|---|
| Operating systems | — |
| AI compatibility | claude |
| License | MIT |
| Pricing | open-source |
| Language | Shell |
简体中文 · English
ssh-vps-skill
一个给 AI agent(Claude Code / openclaw / Codex 等)用的 VPS SSH 管理技能
你只要对 AI 轻轻说一句「帮我把这台新鸡加进来,再把密码登录关掉~」,剩下的它就替你稳稳搞定啦。
它就是一个小小的 skill:一份 SKILL.md 加两个自带的 bash 脚本,丢进你的 AI agent 里,它就学会了怎么帮你把手上的小鸡们都安全、整齐地管起来。跑在你自己电脑上,服务器那头啥都不用装。
底层脚本你想自己手敲也完全可以,不过我更希望它是那种 「你动嘴、它动手」 的小帮手~
它能做的事
- 🔑 一把钥匙管所有小鸡:所有机器都用同一把
~/.ssh/vps,再也不用每台一套、记到头大 - 📇 别名小本本:把 IP / 端口 / 用户名都记成别名,写进
~/.ssh/vps.config并自动接进~/.ssh/config,之后连系统原生的ssh <别名>都能用啦 - 📤 公钥一键送上去:服务商给的密码输一次,公钥就自动追加到远端的
authorized_keys,省心 - 🔒 温柔地关掉密码登录:会先确认你的密钥真的能登进去,登不进就绝不动手,所以不用怕把自己锁在门外;还会顺手处理
sshd_config.d// cloud-init 那些云服务器爱搞的配置覆盖,最后用sshd -T再核对一遍才放心 - 🩺 一眼看遍所有小鸡:批量看哪台在线,查系统 / 内核 / CPU / 内存 / 磁盘 / 在线时长
- 🧩 别名模糊匹配:打
tok就能找到tokyo-1
不只是初始化:让 AI 帮你看家
它最大的意义其实不在「装新机」,而在——装好之后,就等于给 AI 配了一双能安全连上你所有小鸡的手。那些你平时不太懂、或者懒得一条条敲的运维,都可以直接交给它:
- 🛡️ 「帮我看看这台最近有没有被爆破、有没有可疑的登录记录?」
- 🌐 「现在有没有奇怪的对外连接、可疑进程?」
- 📈 「哪个进程把 CPU / 内存吃满了?」
- 🔌 「这台开了哪些端口?有没有不该开的?」
- 🔄 「顺手帮我把系统更新一下~」
你只要说想做什么,AI 就会通过这个 skill 连上去、跑命令、再把结果讲给你听。说白了:你会的、不会的、想做的,都可以交给 AI 在你的 VPS 上替你完成。
怎么装
一键安装(推荐,最省事~)
bash <(curl -sL https://raw.githubusercontent.com/xiao-vvv/ssh-vps-skill/main/install.sh)
默认会装到 ~/.claude/skills/ssh-vps-skill(Claude Code 自己就能认出来)。想换个地方也行:
SSH_VPS_SKILL_DIR=~/你的/skills/ssh-vps-skill bash <(curl -sL https://raw.githubusercontent.com/xiao-vvv/ssh-vps-skill/main/install.sh)
之后再跑同一条命令,它会自动 git pull 帮你更新~
手动安装(Claude Code)
把整个目录放进你的 skills 目录就好:
git clone https://github.com/xiao-vvv/ssh-vps-skill.git ~/.claude/skills/ssh-vps-skill
chmod +x ~/.claude/skills/ssh-vps-skill/scripts/*.sh
其它能跑 shell 的 AI agent(openclaw / Codex 等)
只要这个 agent 能读文件、能执行命令就行:把仓库放到它够得着的地方,让它读一下 SKILL.md 了解命令约定,然后调用 scripts/ssh-vps.sh 就可以啦。
想纯手动用(不配 AI 也没问题)
git clone https://github.com/xiao-vvv/ssh-vps-skill.git ~/ssh-vps-skill
chmod +x ~/ssh-vps-skill/scripts/*.sh
alias ssh-vps='~/ssh-vps-skill/scripts/ssh-vps.sh' # 可以写进 ~/.zshrc / ~/.bashrc
用之前的小准备
它跑在你自己的电脑上(macOS / Linux),需要 bash、python3、openssh(一般都自带),还有 expect(只有「用密码下发公钥」那一步才用得到)。
- macOS:
brew install expect - Debian / Ubuntu:
apt install -y expect
第一步要自己来一次:生成一把专属密钥(脚本不会替你生成哦,没有 ~/.ssh/vps 它会直接提醒你):
ssh-keygen -t ed25519 -f ~/.ssh/vps -C "vps-key"
生成好之后你就有了私钥 ~/.ssh/vps(这把要自己收好,千万别外传~)和公钥 ~/.ssh/vps.pub(这把可以放心公开)。
初次使用的小提示:密钥、SSH 端口、别名都可以按你自己的喜好来设,没有非用不可的值哦:
- 密钥 / 公钥:默认用
~/.ssh/vps。要是你已经有钥匙了,放到这个路径,或者设个环境变量VPS_KEY_PATH=/你的/密钥指过去就行。- SSH 端口:连接端口默认
22(新鸡一般就是 22,可以用--port改);port改端口的默认目标是20266,你可以ssh-vps port <别名> <你想要的端口>,或用VPS_HARDEN_PORT改默认。- 别名:
add <别名> <host>里的别名你随便起(字母 / 数字 /./_/-都行),起个自己记得住的名字就好,比如tokyo-1、hk-bgp~
命令速查
ssh-vps init-key # 首次:本地生成 ~/.ssh/vps(已存在则跳过)
ssh-vps add <别名> <host> --user root --port 22 [--password '密码'] # 加/更新别名;带密码则同时下发公钥
ssh-vps sync-key <别名|host> --password '密码' # 单独下发公钥
ssh-vps <别名> # 直接连接(支持模糊匹配)
ssh-vps <别名> htop # 跑远端命令(交互式自动分配 PTY)
ssh-vps lock <别名> # 验证密钥后关闭密码+键盘交互登录(含 sshd -t 防呆)
ssh-vps port <别名> [端口] # 改 SSH 端口(默认 20266,新旧并存+实测+失败回滚)
ssh-vps list # 列出所有别名
ssh-vps status --all # 批量探活
ssh-vps info <别名> # 查远端系统信息
ssh-vps rm <别名> # 删除别名
端口和密钥都能自己定哦:改端口默认目标是
20266,可以显式传ssh-vps port <别名> 端口,或用环境变量VPS_HARDEN_PORT改默认值;密钥路径默认~/.ssh/vps,也可以用VPS_KEY_PATH指向你自己的密钥。更多可调的见 可配置项。
多行的远端脚本就用 ssh-vps-run.sh,省得跟一堆嵌套引号较劲~
ssh-vps-run.sh myvps <<'REMOTE'
set -euo pipefail
uname -a
ss -lnptu | head
REMOTE
可配置项
| 配置 | 默认 | 怎么改 |
|---|---|---|
| 别名 | 无(自己起) | add <别名> <host> 里随便起,字母/数字/./_/- |
| 密钥路径 | ~/.ssh/vps | 环境变量 VPS_KEY_PATH |
| 连接端口 | 22 | VPS_DEFAULT_PORT,或每个别名的 --port |
| 改端口目标 | 20266 | VPS_HARDEN_PORT,或 port <别名> <端口> |
| 默认用户 | root | VPS_DEFAULT_USER |
| 密码来源 | — | --password / VPS_SSH_PASSWORD / --password-stdin |
一套走下来:从拿到新鸡到锁好
# 0) 首次:先在本地生成专属密钥(已经有了就跳过)
ssh-vps init-key
# 1) 加进来 + 顺便把公钥送上去(一步到位)
ssh-vps add myvps 1.2.3.4 --user root --port 22 --password 'abcd1234'
# 2) 确认一下密钥能登进去
ssh-vps myvps
# 3) 确认能登之后,再放心关掉密码登录(进不去它绝不动手哦)
ssh-vps lock myvps
# 4) 想改端口的话(默认 20266;记得先去服务商安全组放行新端口~)
ssh-vps port myvps
安全方面想跟你叮嘱的
- 私钥
~/.ssh/vps千万别上传服务器、别发给别人、也别提交进任何仓库。仓库自带了.gitignore帮你兜底,不过还是麻烦你自己也确认一下~ - 仓库里的代码不含任何真实 IP / 密码 / 密钥——你真正的连接信息都在本地的
~/.ssh/vps.config和~/.ssh/vps*里,跟这个仓库没关系,放心。 lock在改 SSH 配置前会先确认密钥能登,这是特意留的一道保险;不过任何安全改动之前,都建议你先给自己留一条能用的备用登录方式,稳妥一点总是好的。
License
MIT © xiaov
// faq
What is ssh-vps-skill?
给 AI agent(Claude Code / openclaw / Codex)用的 VPS SSH 管理技能:统一密钥、别名管理、一键下发公钥、安全关闭密码登录、批量探活. It is open-source on GitHub.
Is ssh-vps-skill free to use?
ssh-vps-skill is open-source under the MIT license, so it is free to use.
What category does ssh-vps-skill belong to?
ssh-vps-skill is listed under devops in the Claudeers registry of Claude-compatible tools.
// embed badge
[](https://claudeers.com/ssh-vps-skill)
// retro hit counter
[](https://claudeers.com/ssh-vps-skill)
// reviews
// guestbook
// related in DevOps & CI/CD
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI…
Use Claude Code as the foundation for coding infrastructure, allowing you to decide how to interact with the model while enjoying updates from Anthropic.
Professional Antigravity Account Manager & Switcher. One-click seamless account switching for Antigravity Tools. Built with Tauri v2 + React (Rust).专业的 Antig…
Roadmap to becoming an ASP.NET Core developer in 2026