ssh_process
Start, stop, or check background processes and manage SSH tunnels on remote servers. Listing tasks and opening or closing local port forwards simplifies remote process and tunnel administration.
Instructions
Manage background processes and SSH tunnels on the remote server. Actions: start (launch a detached background process, returns PID), stop (stop a process by PID), status (check if a PID is running), list (list tracked background tasks), tunnel_open (local port forward to remote host:port), tunnel_close (close a tunnel), tunnel_list (list active tunnels).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | No | Process ID (stop/status). | |
| host | No | SSH server hostname or IP. Alternative to session_id/name, can override hosts.json entry. | |
| name | No | Use a pre-configured host from hosts.json by name. Alternative to session_id. | |
| port | No | SSH port (used with host). | |
| action | Yes | Process/tunnel action. | |
| signal | No | Signal to send on stop (TERM, KILL, INT, etc.). | TERM |
| command | No | Command to run (start). | |
| task_id | No | Task ID (stop/status, alternative to pid). | |
| workdir | No | Working directory (start). | /tmp |
| log_file | No | Log file path (start). Default /tmp/bg_<taskid>.log | |
| password | No | SSH password (used with host). | |
| username | No | SSH username (used with host). | |
| local_port | No | Local listen port (tunnel_open). | |
| session_id | Yes | Active SSH session ID. If omitted, connects via name/host/env vars. | |
| remote_host | No | Remote target host (tunnel_open). | |
| remote_port | No | Remote target port (tunnel_open). |