Linux SSH and SCP
Key logins, tunnels, and file copies without passwords.
- ssh key
- ssh tunnel
- scp
- rsync
- ssh-copy-id
Linux SSH and SCP
Key logins, tunnels, and file copies without passwords.
Commands
| Command | What it does |
|---|---|
ssh user at host | Login with keys |
ssh -i keyfile user at host | Pick an identity file |
ssh -L local forward | Forward remote Postgres locally |
scp file to host | Copy a file up |
rsync avz sync | Faster repeat syncs |
Example
ssh-keygen -t ed25519 -C 'laptop'
ssh-copy-id user@host
FAQ
Permission denied (publickey)?
The server ignores keys when ssh dirs are group-writable - fix modes to 700 and 600.
scp vs rsync?
rsync resumes and skips unchanged files; scp always recopies - rsync wins for deploys.
常见问题
Permission denied (publickey)?
The server ignores keys when ssh dirs are group-writable - fix modes to 700 and 600.
scp vs rsync?
rsync resumes and skips unchanged files; scp always recopies - rsync wins for deploys.
Linux
Linux Files and Directories
Navigate, create, move, and inspect files with core commands.
Linux Permissions
Read ls output, chmod, chown, and sudo without breaking access.
Linux Text Processing
cat, head, cut, sort, uniq, and awk for daily data shaping.
Linux grep and find
Find files by name, age, and size; search inside them fast.