ssh

GitHub

通过SSH在远程服务器执行Shell命令的Skill,支持密码、密钥及Agent认证,自动解析凭据并处理代理链配置。

internal/ai/skills/ssh/SKILL.md opskat/opskat

触发场景

需要远程登录服务器执行诊断或运维命令 检查远程主机状态、日志或配置文件

安装

npx skills add opskat/opskat --skill ssh -g -y
更多选项

非标准路径

npx skills add https://github.com/opskat/opskat/tree/main/internal/ai/skills/ssh -g -y

不安装直接使用

npx skills use opskat/opskat@ssh

指定 Agent (Claude Code)

npx skills add opskat/opskat --skill ssh -a claude-code -g -y

安装 repo 全部 skill

npx skills add opskat/opskat --all -g -y

预览 repo 内 skill

npx skills add opskat/opskat --list

SKILL.md

Frontmatter
{
    "name": "ssh",
    "description": "Run shell commands on a remote server over SSH via exec. Covers command syntax and the remote-vs-local distinction."
}

SSH assets

Command syntax

Pass the shell command verbatim as command:

  • uptime
  • systemctl status nginx
  • cat /etc/nginx/nginx.conf
  • df -h | grep -v tmpfs

Notes

  • The command runs on the remote server, never on the user's machine. Tools named local_* operate on the user's own machine and are not interchangeable with this one.
  • Use cat / ls / grep inside the command to inspect remote files.
  • The scope parameter is not used by SSH assets.
  • Credentials are resolved automatically; never ask the user for a password.

Asset config (for put_asset)

field type required notes
host string yes Hostname or IP
port number no Defaults to 22
username string yes Login username
auth_type string no "password", "key", or "agent"; inferred from plaintext/reference/Agent inputs when omitted
password string no Write-only. Encrypted in the asset; never returned and does not create a credential
credential_id number no Existing managed password or SSH-key credential ID; its type infers auth when auth_type is omitted and must match an explicit auth type
agent_source_id number yes for Agent Existing SSH Agent source ID; the source may be offline at save time
agent_key_fingerprint string yes for Agent Canonical SHA256 identity fingerprint; both Agent fields are required and infer Agent auth when auth_type is omitted
ssh_asset_id number no SSH asset to tunnel through; 0 detaches
proxy_chain array no Ordered list of hops, nearest to this machine first; replaces the whole stored chain and the SSH tunnel, [] clears it. Layers: {"type":"ssh","ssh_asset_id":N}, {"type":"socks5","host":"...","port":N,"username":"...","password":"..."}, {"type":"http_tunnel","url":"https://...","token":"...","timeout_seconds":N} (first layer only). password / token are write-only, encrypted in the asset. Not together with ssh_asset_id

password and credential_id are mutually exclusive. Agent auth rejects both; non-Agent auth rejects Agent fields. private_key and passphrase are not accepted by asset automation: create/import the SSH-key credential in the desktop key manager, then pass credential_id. Changing auth clears the old asset association but does not delete a possibly shared credential.

Example:

put_asset(name="web-01", type="ssh", config={"host":"10.0.0.7","username":"root","password":"..."})

版本历史

  • 2b9abfb 当前 2026-10-19 03:58

    新增资产连接配置扩展表单分 Tab、证书可填内容,opsctl 与 put_asset 支持隧道、代理链、TLS 及多层代理链功能

  • b159e91 2026-08-19 20:21

    重构资产配置结构,引入托管凭据自动化与Agent认证支持;强化安全审计与敏感数据脱敏边界。

  • d6c7a6e 2026-08-16 07:29

    修正文档契约漂移,补充auth_type=agent及其相关字段说明。

  • aeb4bc3 2026-07-24 16:28

同 Skill 集合

extensions/notebook/SKILL.md
internal/ai/skills/database/SKILL.md
internal/ai/skills/etcd/SKILL.md
internal/ai/skills/k8s/SKILL.md
internal/ai/skills/kafka/SKILL.md
internal/ai/skills/local/SKILL.md
internal/ai/skills/mongodb/SKILL.md
internal/ai/skills/oss/SKILL.md
internal/ai/skills/rdp/SKILL.md
internal/ai/skills/redis/SKILL.md
internal/ai/skills/serial/SKILL.md
internal/ai/skills/vnc/SKILL.md
plugin/opsctl/skills/opsctl/SKILL.md

元信息

文件数
0
版本
bca05b6
Hash
01694b08
收录时间
2026-07-24 16:28

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-03 18:02
浙ICP备14020137号-1