lexbritvin/SSH Command & Port Forwarding
🛠️ SSH Remote commands and Port forwarding with extensive configuration options. Supports Windows, macOS, Linux.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit May 20, 2026
- License
- MIT
Pinned Snippet
uses: lexbritvin/ssh-action@8e065c2641c8f05fdd9e270d54a9c9e11db23609 # v2.0.0tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| host | Target SSH host (required) | yes | — |
| port | SSH port (default: 22) | no | "" |
| username | SSH username (optional - uses current user or SSH config if not specified) | no | — |
| private-key | SSH private key content (recommended over password) | no | — |
| private-key-path | Path to SSH private key file (recommended over password) | no | — |
| password | SSH password (not recommended - use private key instead) | no | — |
| known-hosts | SSH known_hosts content for host verification | no | — |
| local-forwards | Local port forwards (-L). Format: "local_port:remote_host:remote_port" or "local_host:local_port:remote_host:remote_port". Multiple forwards separated by comma | no | — |
| remote-forwards | Remote port forwards (-R). Format: "remote_port:local_host:local_port" or "remote_host:remote_port:local_host:local_port". Multiple forwards separated by comma | no | — |
| jump-hosts | Comma-separated list of jump hosts (format: user@host:port) | no | — |
| extra-flags | Additional SSH flags and options | no | "" |
| command | Command to execute on remote host (alternative to port forwarding) | no | "" |
| post-command | Command to execute after workflow completion (cleanup tasks) | no | "" |
| timeout | Connection timeout in seconds | no | 30 |
| keep-alive | Send keep-alive packets every N seconds | no | 60 |
| dry-run | Show SSH command without executing (for debugging or to have ssh string) | no | false |
Outputs
| name | description |
|---|---|
| pid | Process ID of the background SSH tunnel |
| allocated-host | Public host for remote forward (when using dynamic port allocation) |
| allocated-port | Allocated port for remote forward (when using dynamic port allocation) |