ssh Command Generator — Connect, Tunnel & Run Commands

Build the exact ssh command — a plain connection, a port-forward tunnel, or a remote command — with every flag explained. Or paste an ssh command to decode it. Runs in your browser.

Your command

Or: decode an ssh command

Paste any ssh command — every flag gets explained.

The shape of an ssh command

At its simplest, ssh user@host opens a shell. From there you bolt on options: a different port (-p), a specific key (-i), a tunnel (-L / -R), or a command to run instead of an interactive shell. Put a command in quotes at the end and ssh runs it remotely and returns the output — perfect for scripts.

Local vs remote tunnels, the part everyone re-googles

Gotchas worth knowing

Frequently asked questions

How do I ssh with a specific key and port?

ssh -i ~/.ssh/id_ed25519 -p 2222 user@host. -i picks the key, -p the port.

How do I create an SSH tunnel?

ssh -L 8080:localhost:5432 -N user@host forwards your local port 8080 to the server's localhost:5432. Visit localhost:8080 to reach it.

How do I run a command over ssh without logging in?

Put the command in quotes: ssh user@host 'df -h' runs it remotely and prints the output, then exits.

Why does ssh ignore my key file?

Usually permissions: the private key must be chmod 600. ssh refuses keys that other users can read.

More shell tools: rsync, curl, chmod, or all on the home page.