← Cheat Sheets
SSH and File Transfer
Connect, copy and tunnel securely.
# SSH and File Transfer
Connect, copy and tunnel securely.
```bash
ssh user@host
ssh -p 2222 user@host # custom port
ssh -i ~/.ssh/key user@host # specific key
ssh-keygen -t ed25519 -C "you@example.com"
ssh-copy-id user@host # install your public key
scp file.txt user@host:/path/ # copy to server
scp -r user@host:/path/dir . # copy from server
rsync -avz src/ user@host:/dest/ # efficient sync
ssh -L 8080:localhost:80 user@host # local port forward
ssh -N -D 1080 user@host # SOCKS proxy
# ~/.ssh/config
Host myserver
HostName example.com
User deploy
IdentityFile ~/.ssh/key
```