scp backup.zip alex@203.0.113.10:/home/alex/ on your own computer. Add -r for a folder and -P 2222 for a custom SSH port. For large folders or repeated copies use rsync -avz ./site/ alex@203.0.113.10:/var/www/site/, which only sends what changed and can resume. Both use your normal SSH login.
Before you start
- You need to be able to SSH into the server.
scpandrsyncuse the same user, port and key. - Run the commands on your own computer, not inside an SSH session, unless you are copying between two servers.
rsyncmust be installed on both machines:sudo apt install rsync(Ubuntu/Debian) orsudo dnf install rsync(AlmaLinux/Rocky).
Should I use scp or rsync?
Since OpenSSH 9.0,
scp uses the SFTP protocol under the hood (release notes), so it works anywhere SFTP works.
How to copy files with scp
The pattern isscp <from> <to>. A remote location is written user@host:path.
scp C:\Users\alex\Downloads\backup.zip alex@203.0.113.10:/home/alex/.
How to copy and sync folders with rsync
-a keeps permissions, times and folder structure, -v lists files, -z compresses during transfer, -P shows progress and keeps partial files.
The trailing slash matters
How to mirror a folder safely
--delete removes files on the destination that no longer exist in the source. Always run it with --dry-run (-n) first and read the list:
n.
How to check it worked
List the copied files on the server and compare sizes:Frequently asked questions
Can I copy files directly between two servers?
Yes. Log in to one server and runscp or rsync there with the other server as the destination. The first server needs a login (password or key) for the second.
Why does scp say “Permission denied”?
Either the login failed (see permission denied (publickey)) or your user can’t write to the target folder. Copy to your home folder first, then move the file withsudo over SSH.
Can I use an SSH config alias with scp and rsync?
Yes. With aHost web entry in your SSH config, scp backup.zip web: and rsync -avz site/ web:/var/www/site/ work.
Is rsync a backup?
It copies files, which is a start. For versioned, encrypted backups see how to back up a Linux server and rsync backups.Related guides
VPS and dedicated server guides
Every guide in this section.
SFTP, WinSCP and FileZilla
Drag-and-drop transfers.
Back up files with rsync
Scheduled rsync backups.
SSH config shortcuts
Shorter scp and rsync commands.
Compress files with tar
Pack a folder before copying.
Checked against the official OpenSSH scp manual and rsync manual on 4 November 2026; all scp and rsync commands, including
--dry-run --delete, were tested with OpenSSH 9.6 and rsync 3.2.7 on Ubuntu 24.04 LTS.Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026