Install
openclaw skills install @psyb0t/ssh-tunnel-swarmBash tool that spins up and holds open MANY concurrent SSH tunnels — both forward (-L) and reverse (-R) — driven by a plain-text rules file. One connection block per host: a header line user@host:port=/path/to/private/key followed by one or more tunnel lines forward|reverse local-iface:local-port:remote-iface:remote-port, blocks separated by blank lines. Each host connection runs in its own background loop (ssh -N -i <key> -o ExitOnForwardFailure=yes -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -o StrictHostKeyChecking=yes) and auto-reconnects with a 5s backoff on drop; SIGINT/SIGTERM tears every tunnel down cleanly. Configured entirely via env vars (RULES_FILE, LOG_ENABLED, LOG_FILE, LOG_LEVEL) — no CLI flags. No password auth, key-based only. Use when the user wants to set up/manage multiple SSH forward or reverse tunnels from a single rules file across one or many hosts.
openclaw skills install @psyb0t/ssh-tunnel-swarmBash tool for running a swarm of SSH tunnels — forward and reverse, many hosts at once
— off one rules file. No daemon, no config DSL beyond plain text, just ssh -L/ssh -R
looped forever per host with auto-reconnect.
reverse) expose a LOCAL service to the REMOTE host. Only point
reverse rules at hosts you trust — a compromised or malicious remote can now reach
whatever you bound on your side.forward) expose a REMOTE service through YOUR local machine.
Same trust logic in reverse: don't forward into networks you don't control.StrictHostKeyChecking=yes — the target host must already be
in known_hosts or the connection fails. That's intentional; don't work around it by
disabling host key checking.chmod 600) and never put keys or the rules file (which references key paths) in a
world-readable location or a git repo.ssh -L/ssh -R
commands or systemd units.ssh -L/ssh -R directly.Plain text file, default path rules.txt, overridable via RULES_FILE. It's a
sequence of connection blocks, separated by blank lines. Each block:
<line 1> user@host:port=/path/to/private/ssh/key
<line 2+> forward|reverse local-interface:local-port:remote-interface:remote-port
... (one or more tunnel lines)
user@hostname:port=/path/to/private/key
user — [a-zA-Z0-9._-]+hostname — hostname or IPv4 (no scheme, no special chars)port — SSH port on the remote host, 0-65535=/path/to/key — path to the private key for THIS connection; must exist on disk
or the tool refuses to start (FATAL at load time).direction local-interface:local-port:remote-interface:remote-port
direction is literally forward or reverse, nothing else.reverse → ssh -R remote-interface:remote-port:local-interface:local-port
(binds on the REMOTE host, forwards back to your LOCAL interface:port).forward → ssh -L local-interface:local-port:remote-interface:remote-port
(binds on your LOCAL interface, forwards to something reachable FROM the remote host).# Host 1: expose a local web app on the VPS (reverse), and reach the VPS's
# internal Postgres from your machine (forward).
deploy@vps1.example.com:22=/home/user/.ssh/deploy_vps1
reverse 0.0.0.0:8080:localhost:3000
forward localhost:15432:127.0.0.1:5432
# Host 2: reach an internal-only admin panel through a jump host (forward),
# and expose your local dev API back to that jump host (reverse).
opsuser@jump.example.com:22=/home/user/.ssh/deploy_jump
forward localhost:9090:10.0.5.20:9090
reverse 127.0.0.1:4000:localhost:4000
With the above: curl http://vps1.example.com:8080 hits your local localhost:3000;
psql -h localhost -p 15432 reaches the VPS's internal Postgres;
curl http://localhost:9090 on your machine reaches 10.0.5.20:9090 through the jump
host; and the jump host's localhost:4000 reaches your local dev API on 4000.
No subcommands, no CLI flags — everything is env vars, one invocation runs the swarm in the foreground until killed:
RULES_FILE=/path/to/rules.txt \
LOG_ENABLED=1 \
LOG_FILE=/path/to/log/file \
LOG_LEVEL=DEBUG \
ssh-tunnel-swarm
Ctrl-C (SIGINT) or SIGTERM kills every tunnel connection cleanly and exits.
Install/build details, the full env var reference, and log-level semantics are in
references/setup.md.