Features
Manage SSH port forwarding and proxy tunnels, including lifecycle management.
Configuration
Referenceconfig.example.yamlthe tunnels section; profile references the connect configuration.
Usage
bash tunnel/scripts/ssh-tunnel.sh forward <profile> <lport>:<rhost>:<rport>
bash tunnel/scripts/ssh-tunnel.sh reverse <profile> <rport>:<lhost>:<lport>
bash tunnel/scripts/ssh-tunnel.sh socks <profile> <local_port>
bash tunnel/scripts/ssh-tunnel.sh proxy <profile> [--local-proxy-port 7890]
bash tunnel/scripts/ssh-tunnel.sh list
bash tunnel/scripts/ssh-tunnel.sh stop <tunnel_id>
bash tunnel/scripts/ssh-tunnel.sh stop-all
Notes
- Tunnel records are stored in
~/.ssh/tunnels.json; list automatically cleans up dead processes - proxy outputs the environment variable commands that need to be executed on the remote end
- Returns 0 on success, non-zero on failure
Token Constraints
- Tunnel list: already concise enough, no optimization needed
- Status check: output only key information (port, PID, status)
- Duplicate information: do not restate known content