← 返回
AI智能 Key 中文

SSH OP

Use the ssh-op helper script to load an SSH private key from 1Password (op) into an in-memory ssh-agent and then run ssh. Use when connecting to hosts that r...
使用 ssh-op 辅助脚本从 1Password 加载 SSH 私钥到内存中的 ssh-agent,然后运行 ssh。用于连接到 r... 的主机。
moodykong
AI智能 clawhub v0.1.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 1,068
下载
💾 41
安装
1
版本
#latest

概述

ssh-op

ssh-op is a wrapper around ssh that:

  • ensures an ssh-agent exists for the current shell
  • loads an SSH key from 1Password via op read ... | ssh-add -
  • then execs ssh with your arguments

Prerequisites

Fail-fast checks you can run:

command -v op ssh ssh-agent ssh-add
op whoami

If op whoami fails:

  • Sign in to 1Password CLI (desktop integration / account sign-in), or
  • If using a service account flow, ensure OP_SERVICE_ACCOUNT_TOKEN is set.

Configuration (portable)

Machine-specific config lives alongside the skill:

  • Example (do not edit): ~/.openclaw/skills/ssh-op/config.env.example
  • Real (machine-specific): ~/.openclaw/skills/ssh-op/config.env

Required keys:

  • SSH_OP_VAULT_NAME — 1Password vault containing the key
  • SSH_OP_ITEM_TITLE — 1Password item title

Optional keys:

  • SSH_OP_KEY_FIELD — defaults to private key
  • SSH_OP_KEY_FINGERPRINT_SHA256 — if set, skip re-loading when already in ssh-agent
  • SSH_OP_HOSTS_FILE — defaults to hosts.conf (ssh config snippet filename)

SSH host entries (optional) live in:

  • ~/.openclaw/skills/ssh-op/hosts.conf

Initialization / installation / onboarding

Preferred (chat-first)

Because the primary interface is chat (Telegram), the preferred onboarding flow is:

  1. Ask Boss the required questions in chat.
  2. Write the real config file: config.env.
  3. Run a smoke test (e.g. ssh-op --help and a safe ssh-op -T ).

Optional (terminal)

If you are running in a real terminal, you can use the interactive onboarding script:

~/.openclaw/skills/ssh-op/scripts/onboard.sh

(If you want a step-by-step runbook, see references/onboarding.md.)

1) Put the executable on PATH

Canonical executable lives inside the skill:

  • ~/.openclaw/skills/ssh-op/scripts/ssh-op

For convenience, create a symlink:

mkdir -p ~/.local/bin
ln -sf ~/.openclaw/skills/ssh-op/scripts/ssh-op ~/.local/bin/ssh-op

2) Configure which key to load

Run onboarding to populate the real config:

~/.openclaw/skills/ssh-op/scripts/onboard.sh

(Or edit config.env manually and set SSH_OP_VAULT_NAME / SSH_OP_ITEM_TITLE.)

Then validate:

ssh-op --help
# try a safe ssh command (or any host alias you have configured)
ssh-op -T <host-alias>

3) (Optional) Manage ~/.ssh/config host aliases

  1. Put desired Host entries in hosts.conf
  2. Apply them idempotently (adds/updates a managed block):
~/.openclaw/skills/ssh-op/scripts/ensure_ssh_config.py

This will update ~/.ssh/config between:

  • # BEGIN ssh-op (managed)
  • # END ssh-op (managed)

Usage

ssh-op <ssh-args...>

Examples:

ssh-op my-host-alias
ssh-op -T my-host-alias
ssh-op -L 8080:localhost:8080 my-host-alias

Notes / behavior

  • No private key is written to disk.
  • ssh-agent lifetime is tied to the current shell unless you export SSH_AUTH_SOCK / SSH_AGENT_PID.

Executables / bin placement

  • Keep the canonical executable in the skill folder (scripts/ssh-op).
  • Use a symlink (e.g. ~/.local/bin/ssh-op) for convenience.

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-29 12:34 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,055 📥 795,868
productivity

Task Father

moodykong
基于文件的长期任务状态机生成器(注册表、任务文件夹、生命周期状态、队列文件和 Cron 规格)
★ 0 📥 1,942
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,349 📥 317,696