适用环境(当前):
/home/krex/.openclaw/workspace-hermes/ssh-agentd/bin/ssh-agentd/home/krex/.openclaw/ssh-agentd/hosts.yamlssh-agentd.service127.0.0.1:18081sudo systemctl is-enabled ssh-agentd.service
sudo systemctl is-active ssh-agentd.service
ss -ltnp | grep 18081
sudo systemctl status ssh-agentd.service --no-pager -l | sed -n '1,80p'
sudo systemctl daemon-reload
sudo systemctl enable --now ssh-agentd.service
sudo systemctl restart ssh-agentd.service
sudo systemctl stop ssh-agentd.service
1) 默认使用 Bearer Token 鉴权(若配置启用)
2) 本机常有代理变量,调用本地 API 时必须绕过代理
推荐统一用脚本:scripts/api.sh
SSH_AGENTD_TOKEN='<token>' \
scripts/api.sh POST /run '{"host":"nas","cmd":"hostname && whoami","timeoutSec":10}'
SSH_AGENTD_TOKEN='<token>' scripts/api.sh GET /sessions
SSH_AGENTD_TOKEN='<token>' scripts/api.sh GET /metrics
SSH_AGENTD_TOKEN='<token>' scripts/api.sh GET /health
apiAuth.enabled/token 配置Authorization: Bearer --noproxy '*' 或临时 unset 代理变量(脚本已内置)known_hostshosts.yaml 放进仓库。status + /health + /sessions。共 1 个版本