一键导入
sudo-password
Use sudo in terminal without interactive prompts via .env.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use sudo in terminal without interactive prompts via .env.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guides Cloudflare One Zero Trust and SASE work across Access, Gateway, WARP, Tunnel, Cloudflare WAN, DLP, CASB, device posture, and identity. Use when designing, configuring, troubleshooting, or reviewing Cloudflare One deployments. Retrieval-first: use current Cloudflare docs/API schemas instead of embedded product docs.
Use when scheduling recurring polls, read-only monitors, or background jobs that must survive shell session boundaries.
Discover, register, and maintain Hermes skills from non-default paths (plugin directories, external repos, shared vaults). Use when skills are missing from `skills_list()`, when the user mentions plugin skills, when symlinking skills, or when reconciling duplicate/overlapping skills between the default tree and external sources.
Operate the Antigravity CLI (agy): plugins, auth, sandbox.
Tune HERMES_STREAM_RETRIES for mid-stream reconnect resilience.
Manage parallel Hermes sessions in Telegram topics.
| name | sudo-password |
| description | Use sudo in terminal without interactive prompts via .env. |
| version | 0.1.0 |
| author | Hermes |
| platforms | ["macos","linux"] |
| metadata | {"hermes.tags":["Terminal","Sudo","Security"]} |
Hermes automatically rewrites bare sudo commands to read the password from stdin via sudo -S -p '', piping the value of SUDO_PASSWORD from ~/.hermes/.env. No interactive prompt appears, and no sudo -S should ever be typed manually. If SUDO_PASSWORD is absent, the command falls through gracefully — sudo reports "a password is required" rather than blocking. On messaging platforms, the output includes a tip to set SUDO_PASSWORD in .env.
terminal output.SUDO_PASSWORD set in ~/.hermes/.env (or the profile-aware equivalent: get_hermes_home()/.env).Set it via setup wizard:
hermes setup
The wizard prompts for "Sudo password" and writes it to .env via save_env_value("SUDO_PASSWORD", ...).
Set it manually by adding a line to ~/.hermes/.env:
SUDO_PASSWORD=yourpassword
The key is also configurable through hermes config (category: setting, password-masked).
Invoke the command through the terminal tool exactly as you normally would — write sudo apt update, not sudo -S apt update. The transform fires automatically before execution:
_rewrite_real_sudo_invocations scans the command string for the bare token sudo at command-start positions (after ;, |, &, (, newlines, &&, ||).sudo token is replaced with sudo -S -p ''._transform_sudo_command prepends SUDO_PASSWORD\n to the subprocess stdin.| Item | Value |
|---|---|
| Env var | SUDO_PASSWORD |
| Config location | ~/.hermes/.env (profile-aware) |
| Transform | sudo → sudo -S -p '' + stdin pipe |
| Interactive fallback | HERMES_INTERACTIVE=1 → 45s prompt, cached per session |
| NOPASSWD hosts | Probed via sudo -n true; if it works, command runs unchanged |
| Guard | Explicit sudo -S without SUDO_PASSWORD is hardline-blocked |
Write the command with bare sudo — never add -S yourself:
sudo systemctl restart nginx
sudo apt update && sudo apt upgrade -y
Invoke through the terminal tool. The transform handles single commands, chained commands (&&, ||), and multi-line scripts.
If output contains "sudo: a password is required" or "sudo: no tty present":
SUDO_PASSWORD is set: search_files in ~/.hermes/.env for SUDO_PASSWORD..env and restart the agent session (env is read at boot).On a host with sudoers NOPASSWD, no .env entry is needed. Hermes probes sudo -n true on each call (local backend only) and skips the pipe if NOPASSWD works.
sudo -S manually. When SUDO_PASSWORD is NOT set, the hardline blocklist in tools/approval.py catches explicit sudo -S as a brute-force attack vector and blocks it unconditionally — even with --yolo or approvals.mode=off. When SUDO_PASSWORD IS set, the transform injects -S internally, so adding it yourself is redundant and can confuse the stdin pipe.SUDO_PASSWORD is loaded from .env when the agent process starts. Editing .env mid-session does not take effect until restart.SUDO_PASSWORD, sudo cannot prompt on Telegram/Discord/etc. — it fails immediately. The failure output includes a tip pointing to .env.HERMES_INTERACTIVE=1, CLI only): if SUDO_PASSWORD is unset, Hermes prompts once with a 45s timeout and caches the password for the session via _set_cached_sudo_password. This path does not work on messaging platforms._sudo_nopasswd_works) returns False for any TERMINAL_ENV other than local.SUDO_PASSWORD= (empty) tells Hermes to try an empty password without prompting — useful for hosts with passwordless sudo configured via a different mechanism._read_shell_token) only matches sudo at command-start positions, not inside strings, comments, or variable assignments.Run a harmless sudo command through the terminal tool:
sudo true
If SUDO_PASSWORD is correctly configured, the command exits 0 with no prompt and no "a password is required" message. If it fails, check .env.