portal_tunnel
Open, close, or list SSH tunnels. Supports local port forwarding, reverse tunnels, and SOCKS5 proxy through a single host.
Instructions
Manage SSH tunnels — a single entry point (like portal_host) where
action selects the operation and the other args parameterise it.
Actions
action="open": open a tunnel through
host.kindpicks the type:kind="local" : forward localhost:local_port → remote_host:remote_port via host. Required: remote_host, remote_port (local_port 0 = auto). Example: portal_tunnel(action="open", kind="local", host="bastion", local_port=5432, remote_host="db.internal", remote_port=5432)
kind="reverse": expose local_bind:local_port to host as host:remote_port. Required: remote_port, local_bind, local_port. Example: portal_tunnel(action="open", kind="reverse", host="bastion", remote_port=8080, local_bind="127.0.0.1", local_port=3000)
kind="socks" : SOCKS5 proxy on localhost:local_port via host. Required: local_port (default 1080). Example: portal_tunnel(action="open", kind="socks", host="bastion", local_port=1080)
Returns {tunnel_id, type, host, local, remote}.
action="close": close a live tunnel. Required: tunnel_id (from open). Example: portal_tunnel(action="close", tunnel_id="ab12cd34")
action="list": list all active tunnels (JSON array).
Tunnels are a resource you manage explicitly (open → close), so list
lives here rather than in portal_audit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | ||
| kind | No | local | |
| action | Yes | ||
| tunnel_id | No | ||
| local_bind | No | 127.0.0.1 | |
| local_port | No | ||
| remote_host | No | ||
| remote_port | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |