Skip to main content

SSH Cheat Sheet 2026 — Quick CLI Command Reference

SSH Cheat Sheet 2026 — Quick Command Reference

SSH Cheat Sheet is the complete quick-reference of SSH commands grouped by function. Copy any command with one click and find what you need with Ctrl+F in under 3 seconds.

SSH Connections & Tunnels

Action Command Useful flags
Connect to a remote server
ssh <username>@<remote_host>
Connect to a remote server with a specific [i]dentity (private key)
ssh -i <path/to/key_file> <username>@<remote_host>
Connect to a remote server with IP `10.0.0.1` and using a specific [p]ort (Note:
ssh <username>@10.0.0.1 -p <2222>
Run a command on a remote server with a [t]ty allocation allowing interaction wi
ssh <username>@<remote_host> -t <command> <command_arguments>
SSH tunneling: [D]ynamic port forwarding (SOCKS proxy on `localhost:1080`)
ssh -D <1080> <username>@<remote_host>
SSH tunneling: Forward a specific port (`localhost:9999` to `example.org:80`) al
ssh -L <9999>:<example.org>:<80> -N -T <username>@<remote_host>
SSH [J]umping: Connect through a jumphost to a remote server (Multiple jump hops
ssh -J <username>@<jump_host> <username>@<remote_host>
Close a hanged session
<Enter><~><.>

⚠️ Dangerous / Destructive Commands

These commands are irreversible. Verify your environment (dev/staging vs prod) before running them.

Action Command Warning
⚠️ Destroy ⚠️
terraform destroy -auto-approve
Irreversible — verify the target before running
⚠️ Delete
kubectl delete namespace production
Irreversible — verify the target before running
⚠️ Prune ⚠️
docker system prune -af --volumes
Irreversible — verify the target before running
⚠️ Delete
pvesh delete /nodes/{node}/qemu/{vmid}
Irreversible — verify the target before running
⚠️ Delete
az group delete --name MyResourceGroup --yes
Irreversible — verify the target before running

FAQ — Frequently Asked Questions

What is the difference between SSH Connections & Tunnels and the other groups?

Each group in this SSH cheat sheet covers a distinct area. SSH Connections & Tunnels focuses on its specific scope, while the other groups and the remaining groups cover networking, storage, security and diagnostics respectively.

How do I check the installed SSH version?

Run the version command (usually ssh version or ssh --version). The output shows the client and, when applicable, the server version.

Why does SSH return ‘permission denied’?

A ‘permission denied’ error in SSH usually means the current user lacks sufficient privileges or credentials are not configured. Check: (1) assigned IAM/RBAC roles, (2) an active authentication context via the corresponding login command.

How do I filter SSH output by status or name?

Use flags such as --filter, --selector or --query depending on the tool. You can also pipe into grep or jq to process JSON:

ssh list | grep RUNNING

What is the fastest way to debug a SSH error?

Add the verbose flag (--verbose, -v or --debug) to the failing command. This reveals the underlying HTTP/API calls and the full error response body.

Official sources & references

Commands cross-checked against vendor documentation and high-authority repositories: