lexbritvin/SSH Command & Port Forwarding

🛠️ SSH Remote commands and Port forwarding with extensive configuration options. Supports Windows, macOS, Linux.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit May 20, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: lexbritvin/ssh-action@8e065c2641c8f05fdd9e270d54a9c9e11db23609 # v2.0.0

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
hostTarget SSH host (required)yes
portSSH port (default: 22)no""
usernameSSH username (optional - uses current user or SSH config if not specified)no
private-keySSH private key content (recommended over password)no
private-key-pathPath to SSH private key file (recommended over password)no
passwordSSH password (not recommended - use private key instead)no
known-hostsSSH known_hosts content for host verificationno
local-forwardsLocal port forwards (-L). Format: "local_port:remote_host:remote_port" or "local_host:local_port:remote_host:remote_port". Multiple forwards separated by commano
remote-forwardsRemote port forwards (-R). Format: "remote_port:local_host:local_port" or "remote_host:remote_port:local_host:local_port". Multiple forwards separated by commano
jump-hostsComma-separated list of jump hosts (format: user@host:port)no
extra-flagsAdditional SSH flags and optionsno""
commandCommand to execute on remote host (alternative to port forwarding)no""
post-commandCommand to execute after workflow completion (cleanup tasks)no""
timeoutConnection timeout in secondsno30
keep-aliveSend keep-alive packets every N secondsno60
dry-runShow SSH command without executing (for debugging or to have ssh string)nofalse
namedescription
pidProcess ID of the background SSH tunnel
allocated-hostPublic host for remote forward (when using dynamic port allocation)
allocated-portAllocated port for remote forward (when using dynamic port allocation)