SFTP vs SCP: Which Should You Use?
SFTP and SCP both copy files securely over SSH, but they work very differently. Here’s how they compare on features, speed and security, when to use each one, and where rsync fits in, with copy-and-paste commands.
Side-by-side comparisonscp & sftp commandsrsync explainedWindows, Mac & Linux
Short answer
Use SFTP, and keep using the scp command
SFTP is the modern, full-featured protocol. It can list, rename, delete and resume files, and every graphical file transfer app supports it.
The old SCP protocol is outdated, and the OpenSSH developers recommend against it. But the scp command is still fine: since OpenSSH 9.0 (2022), it uses the SFTP protocol behind the scenes. You get the simple scp syntax with SFTP underneath.
Pick the right tool
- Copy one file quickly:
scp - Browse, upload and manage files:
sftpor an SFTP app - Sync folders or back up:
rsync - Big transfer that might get interrupted:
rsync --partialor SFTP’sreput
Compare
SFTP vs SCP at a glance
| SFTP | SCP (legacy protocol) | |
|---|---|---|
| Runs over | SSH, port 22 | SSH, port 22 |
| Encryption and login | Same as SSH: passwords or keys | Same as SSH: passwords or keys |
| List and browse remote folders | Yes | No |
| Rename, delete, change permissions | Yes | No |
| Resume interrupted transfers | Yes (reget, reput) | No |
| Interactive session | Yes | No, one command per copy |
| Graphical apps | WinSCP, FileZilla, Cyberduck, Transmit and more | Few, mostly WinSCP |
| Speed | Fast with modern OpenSSH | Fast, but no longer faster in practice |
| Status | Actively developed, the standard | Deprecated by OpenSSH; scp now uses SFTP |
The basics
What are SFTP and SCP?
scp
scp command examples
The pattern is scp source destination. Remote paths are written as user@server:path.
Upload a file to your home folder
scp report.pdf user@server:~/
Download a file to the current folder
scp user@server:/var/log/app.log .
Copy a whole folder (-r)
scp -r website/ user@server:/var/www/
Use a different port (capital -P)
scp -P 2222 backup.tar.gz user@server:~/
Watch out: scp and sftp use a capital -P for the port, while ssh uses a lowercase -p.
sftp
sftp command examples
Run sftp user@server to open an interactive session, then use these commands at the sftp> prompt:
| Command | What it does |
|---|---|
ls / cd | List and change remote folders |
lls / lcd | List and change local folders |
put file | Upload a file (put -r for folders) |
get file | Download a file (get -r for folders) |
reput / reget | Resume an interrupted upload or download |
rename, rm, mkdir | Manage remote files and folders |
exit | Close the session |
Open an SFTP session
sftp user@server
Connect on a custom port
sftp -P 2222 user@server
Run commands from a file (scripts)
sftp -b upload.txt user@server
What about rsync?
rsync: the best choice for syncing
rsync also runs over SSH, but it compares the source and destination and only sends what changed. That makes repeat transfers, backups and deployments dramatically faster than copying everything again with scp or sftp.
It’s built into macOS and Linux. On Windows, run it inside WSL. The server needs rsync installed too.
Sync a folder to a server
rsync -avz site/ user@server:/var/www/site/
Resume-friendly copy with progress
rsync -avz --partial --progress big.iso user@server:~/
FAQ
SFTP and SCP questions, answered
Is SCP deprecated?
The SCP protocol is considered outdated and the OpenSSH project recommends SFTP or rsync instead. The scp command itself is not going away: since OpenSSH 9.0 it transfers files using the SFTP protocol by default.
Is SFTP faster than SCP?
For most transfers they now perform about the same. The old SCP protocol could be slightly quicker for a single large file on high-latency links, but modern OpenSSH versions of sftp send multiple requests at once, which closes the gap.
Are SFTP and SCP equally secure?
Both encrypt everything using SSH. The difference is the protocol design: SCP had flaws that let a malicious server overwrite files on your computer, which is one reason OpenSSH moved scp to SFTP.
Do SFTP and SCP use the same port?
Yes. Both run over SSH, so they use port 22 by default, or whatever port your SSH server listens on.
Is SFTP the same as FTPS?
No. SFTP runs over SSH. FTPS is the older FTP protocol wrapped in TLS encryption, with its own ports and firewall rules. Most Linux servers support SFTP out of the box but need extra software for FTPS.
Can I use scp and sftp on Windows?
Yes. Windows 10 and 11 include both commands as part of the built-in OpenSSH client. Open PowerShell or Windows Terminal and use the same syntax as on Mac or Linux.
Skip the password prompts
scp, sftp and rsync all log in with your SSH key. Create one in seconds, right in your browser.