원클릭으로
ssh-security
SSH 安全加固。密钥认证、禁用密码登录、修改端口、fail2ban、authorized_keys 管理。涉及 SSH 安全配置时使用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
SSH 安全加固。密钥认证、禁用密码登录、修改端口、fail2ban、authorized_keys 管理。涉及 SSH 安全配置时使用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
生成或审计模块的 SPEC.md。使用场景:用户要求"给 XX 模块写 spec"、"审计所有 spec"、"检查 spec 是否过期"。
Automates SailFish release workflow: fix build/type errors, update CHANGELOG (EN + CN), run npm version with pre/post hooks. Use when the user asks to release, 发版, 发布, bump version, or update changelog.
后端代码修改后,通过 CLI 测试验证功能正确性。使用场景:修改了 electron/services/ 下的代码需要测试、准备提交代码前跑回归、用户要求"跑测试"/"验证一下"。
完成新功能开发或较大修改后,使用本机 Claude CLI 进行代码审查。
使用 ts-morph 静态分析工具查询代码结构(类层次、方法签名、引用、依赖等),替代手动读源码。使用场景:需要了解类的方法/属性、继承链、符号引用、文件结构、依赖关系时。
When committing or staging changes, only include files related to the current task or conversation; do not stage or commit unrelated modifications. Use when the user asks to commit, stage, 提交, or when preparing to run git add/commit.
| name | ssh-security |
| description | SSH 安全加固。密钥认证、禁用密码登录、修改端口、fail2ban、authorized_keys 管理。涉及 SSH 安全配置时使用。 |
| version | 1.0.0 |
生成密钥(ed25519 推荐):
ssh-keygen -t ed25519 -C "user@host" -f ~/.ssh/id_ed25519 -N ""
分发公钥:
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@remote
# 或手动追加
cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys
编辑 /etc/ssh/sshd_config:
PasswordAuthentication no
PubkeyAuthentication yes
PermitRootLogin prohibit-password # 或 no
生效:sudo systemctl restart sshd。先确认密钥登录可用再禁用密码。
# sshd_config
Port 2222
防火墙放行:sudo ufw allow 2222/tcp(若用 ufw)。
安装:sudo apt install fail2ban
配置 /etc/fail2ban/jail.local:
[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 3600
操作:
sudo systemctl enable fail2ban
sudo fail2ban-client status sshd
限制命令:
command="/usr/bin/rsync --server -vlogDtprze.Lsf ." ssh-ed25519 AAAAC3... backup@server
限制来源 IP:from="192.168.1.0/24"
禁用端口转发:restrict(OpenSSH 8.0+)