rsync vs scp: which one to copy files over SSH
The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
- tool
- rsync
- compares
- rsync vs scp
Use rsync to copy or keep directories in sync: it compares source and destination and only sends what changed, can resume, preserve metadata and delete files that no longer exist at the source. Use scp for a quick one-off copy of a few files: it is installed wherever OpenSSH is and always sends the whole file. Both use SSH for transport and authentication.
Criterion by criterion
| Criterion | rsync | scp |
|---|---|---|
| Repeated copies | sends only changed blocks | sends every file in full |
| Resume an interrupted copy | yes (--partial, --append-verify) | no |
| Mirror and delete removed files | yes (--delete) | no |
| Dry run | yes (-n) | no |
| Preserve permissions, times, links | yes (-a) | times and modes with -p |
| Installed by default | often, but not everywhere | with every OpenSSH client |
| Protocol | rsync over SSH (rsync needed on both ends) | SFTP by default since OpenSSH 9.0 |
Typical commands
# mirror a directory, show progress, delete files removed at the source
rsync -avh --delete --progress ./site/ user@host:/var/www/site/
# preview what would change
rsync -avhn --delete ./site/ user@host:/var/www/site/
# copy one file with scp
scp ./backup.tar.gz user@host:/srv/backups/Sources
Related pages
errors · sshPermission denied (publickey) with sshssh fails with Permission denied (publickey) when the server accepts only keys and none you offer is authorized. Check the key, the user and file permissions.config · ssh~/.ssh/config: Host, HostName, User, Port and IdentityFile~/.ssh/config defines per-host SSH settings: an alias with Host, the real name with HostName, plus User, Port and IdentityFile. Check the result with ssh -G.changes · sshOpenSSH 9.9 to 10.x: incompatible changes from 10.0 to 10.6OpenSSH 10.x: DSA removed and modp DH off by default in sshd (10.0), agent sockets moved to ~/.ssh/agent (10.1), stricter user names on the command line (10.6).