ssh-guard

Reviewed at commit c901585

Refuses ssh/scp/rsync to hosts listed in memory decommissioned_hosts.md; "# decommissioned-ok" overrides.

Made by
escapeboy
What we checked

Blocks Bash commands that run ssh, sftp, mosh, scp or rsync to a host listed in your retired-hosts Markdown file (default ~/.claude/decommissioned_hosts.md), telling Claude to ask you first. Adding '# decommissioned-ok' to the command lets it through. It reads only that file and does nothing when the file is missing.

Review details

Static review of the source at the pinned commit; not run. Registers session.start (reads the hosts file, option hosts_file, with ~ expanded from HOME, and parses '## name - ip (aliases)' headers) and tool.call for Bash. For each ssh, sftp, mosh, scp or rsync target found by simple word splitting, it runs `ssh -G <host>` (prints the resolved ssh config without connecting, though a Match exec rule in your own ssh config would run its command) and denies the call if the host, its IP or its resolved hostname is on the list, with a message naming the matching entry. Only the host argument is passed to ssh -G and option-looking words are skipped. The override string is plain text in the command, so Claude can add it itself; the deny message says to do so only after the user agrees. Parsing is heuristic and can miss unusual command forms. Errors in the handler are caught and the command is allowed. No network, store or model use. npm dependencies: none.

What it uses
  • Reads your prompts: no
  • Sees tool calls: yes
  • Blocks or changes tool calls: yes
  • Reads or writes files: yes
  • Runs programs on your machine: yes
  • Calls the model (uses tokens): no
  • Sends data over the network: no
  • Stores data: no
  • Shows something on screen: no
Hooked events
Made this mod? Add a badge to your README

modsforClaude badge for ssh-guard

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/ssh-guard.svg)](https://modsforclaude.com/mods/ssh-guard/)

← All mods