Cheat Sheet
The commands you keep forgetting, with a one-line description and a real example you can copy - 384 across 26 tools. Pick a tool in the sidebar, or search across all of them.
SSH & scp
Connect to remote machines, copy files, and manage keys.| Command | What it does | Example |
|---|---|---|
ssh | Connect to a remote host. | ssh [email protected] |
ssh -p | Connect on a non-default port. | ssh -p 2222 [email protected] |
ssh -i | Use a specific private key. | ssh -i ~/.ssh/id_ed25519 [email protected] |
ssh-keygen | Generate a new key pair. | ssh-keygen -t ed25519 -C "[email protected]" |
ssh-copy-id | Install your public key on a server. | ssh-copy-id [email protected] |
ssh (run a command) | Run one command remotely and exit. | ssh [email protected] "df -h" |
scp (upload) | Copy a local file to a remote host. | scp app.tar.gz [email protected]:/home/ana/ |
scp (download) | Copy a remote file to your machine. | scp [email protected]:/var/log/app.log . |
scp -r | Copy a whole folder. | scp -r ./site [email protected]:/var/www/ |
ssh -L | Tunnel a remote port to your machine. | ssh -L 8080:localhost:80 [email protected] |
ssh (config alias) | Connect using a ~/.ssh/config Host alias. | ssh prod |
ssh-add | Add a key to the running ssh-agent. | ssh-add ~/.ssh/id_ed25519 |
ssh-keygen -R | Remove a stale host key after a rebuild. | ssh-keygen -R server.com |