How to Transfer Files to a VPS: SFTP, SCP and rsync
How to transfer files to a VPS with SFTP, SCP and rsync from Windows, macOS or Linux, plus Remote Desktop drive sharing for Windows servers.
This guide shows you how to transfer files to a VPS from Windows, macOS or Linux, whether the server runs Ubuntu 24.04 or Windows Server 2022 or 2025. It covers SFTP, SCP and rsync over SSH, a graphical client, and Remote Desktop drive sharing for Windows servers, with commands to copy and the mistakes to avoid. The options and defaults come from each tool's official documentation, checked on 3 November 2026.
Ways to transfer files to a VPS compared
Use SFTP or SCP for everyday uploads and downloads, rsync for large or repeated transfers, and Remote Desktop drive sharing when you already manage a Windows server over RDP.
| Method | Server | Best for | Keep in mind |
|---|---|---|---|
SFTP (sftp) |
Linux, or Windows with OpenSSH Server | Browsing folders and moving a few files | Can resume an interrupted transfer |
SCP (scp) |
Linux, or Windows with OpenSSH Server | One file or folder in a single command | Runs over the SFTP protocol since OpenSSH 9.0 |
| rsync over SSH | Linux, with rsync installed on both ends | Large folders, repeated syncs, slow links | A trailing slash changes what is copied |
| GUI client (WinSCP) | Any SFTP server | Point-and-click transfers from Windows | Choose SFTP, not plain FTP |
| RDP drive redirection and clipboard | Windows | Files you work with inside the RDP session | Switch it on before you connect |
SFTP, SCP and rsync all run over SSH, so on a Linux VPS they work with the login you already use and need no extra port. [1] [2] [3] Replace the example address 203.0.113.10 and user deploy with your own.
Copy files to a Linux VPS with scp
scp copies files and folders between your computer and the server in one command, with the same authentication as an SSH login. [1] A remote location is written as user@host:path. [1] Run the commands on your own computer, in a terminal or, on Windows, in PowerShell.
# Upload a file to the VPS
scp backup.tar.gz deploy@203.0.113.10:/home/deploy/
# Download a file into the current folder
scp deploy@203.0.113.10:/home/deploy/report.csv .
# Upload a whole folder
scp -r ./site deploy@203.0.113.10:/home/deploy/
# SSH listens on port 2222
scp -P 2222 backup.tar.gz deploy@203.0.113.10:/home/deploy/The -r option copies whole folders, and scp follows any symbolic links it meets inside them. [1] The port option is a capital -P, because the lowercase -p preserves file times and permissions. [1]
What changed in OpenSSH 9.0
Since OpenSSH 9.0, scp transfers files with the SFTP protocol by default instead of the old SCP protocol. [1] The old protocol relied on the remote shell to match wildcard patterns, so file names with special characters needed careful quoting. [1] You still type the same scp command. If a server does not support SFTP, or an old script depends on legacy wildcard or ~ path handling, add -O to use the legacy protocol. [1]
Browse and move files with sftp
sftp opens an interactive session, similar to FTP, but it runs every operation over an encrypted SSH connection. [2]
sftp deploy@203.0.113.10
# SSH on port 2222
sftp -P 2222 deploy@203.0.113.10cd /home/deploy/uploads
lcd Downloads
put backup.tar.gz
get report.csv
put -R site
reput big-file.iso
byecd and ls work on the server, while lcd and lls work on your own computer. [2] put uploads, get downloads and -R copies a whole folder; unlike scp, sftp does not follow symbolic links inside a folder. [2] If a big transfer breaks off, reput or reget resumes it; this assumes the partial copy matches the original, and if it does not, the result is likely to be corrupt. [2] Type bye to quit.
For scheduled jobs, sftp -b reads its commands from a file, and the manual recommends non-interactive login, such as an SSH key, so no password prompt stops the job. [2]
Sync large or repeated transfers with rsync
rsync suits big folders and copies you repeat: it skips files whose size and modification time have not changed, and for changed files it sends only the differences. [3] For remote copies it normally runs over SSH, which authenticates the server and encrypts the connection. [3]
rsync has to be installed on both your computer and the VPS, and most Linux distributions offer it as a package. [3]
sudo apt install rsyncThe options you will use most:
-acopies folders recursively and keeps almost everything, including permissions, times and symbolic links; it does not keep ACLs, extended attributes or hard links. [3]-vlists the files being transferred and ends with a short summary. [3]-zcompresses file data on the way, which helps on a slow connection. [3]--partialkeeps a partly transferred file so the next run can finish it,--progressshows progress, and-Pturns on both. [3]--dry-run(-n) shows what would happen without changing anything. [3]-e 'ssh -p 2222'connects to SSH on another port. [3]
# Preview: shows what would be copied, changes nothing
rsync -avz --dry-run ./site/ deploy@203.0.113.10:/home/deploy/site/
# Upload the folder's contents
rsync -avz ./site/ deploy@203.0.113.10:/home/deploy/site/
# Download a folder from the VPS
rsync -avz deploy@203.0.113.10:/home/deploy/site/ ./site-copy/
# A large file that may be interrupted, with SSH on port 2222
rsync -avP -e 'ssh -p 2222' backup.tar.gz deploy@203.0.113.10:/home/deploy/If you sync backups to a second server, our guide to using a storage VPS for backups covers retention, encryption and restore tests.
The trailing-slash rule
A slash at the end of the source means "copy the contents of this folder"; without it, rsync copies the folder itself by name. [3]
# Creates /home/deploy/site/ on the VPS
rsync -av ./site deploy@203.0.113.10:/home/deploy/
# Copies what is inside site straight into /home/deploy/
rsync -av ./site/ deploy@203.0.113.10:/home/deploy/When in doubt, add --dry-run and read the file list before the real run.
Delete extra files only after a dry run
To mirror a folder, --delete removes files on the receiving side that no longer exist on the sending side, and the rsync manual warns that the option can be dangerous if used incorrectly. [3]
Run every --delete command with --dry-run first and read the list of files it would remove. A wrong destination path or a missing trailing slash on the source can delete files you meant to keep.
rsync -av --delete --dry-run ./site/ deploy@203.0.113.10:/home/deploy/site/
rsync -av --delete ./site/ deploy@203.0.113.10:/home/deploy/site/Transfer files from Windows with OpenSSH or WinSCP
Windows has the same scp and sftp commands. Beginning with Windows 10 build 1809 and Windows Server 2019, OpenSSH is available as a feature on demand, and its tools include scp and sftp. [4] rsync is not one of them, so from Windows use scp, sftp or a graphical client. [4]
Open PowerShell as Administrator, check whether the OpenSSH client is present, and add it if its state is NotPresent. [5]
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0Then run the same commands in a normal PowerShell window:
cd $HOME\Downloads
scp backup.zip deploy@203.0.113.10:/home/deploy/
scp deploy@203.0.113.10:/home/deploy/report.csv .
sftp deploy@203.0.113.10If you prefer a graphical client, WinSCP does the same job. It supports SFTP, SCP, FTP, WebDAV and S3, and by default it connects with SFTP and falls back to SCP; you pick the protocol on its login dialog. [6] Its protocol comparison lists transfer resume as supported with SFTP but not in its SCP mode, so stay on SFTP for large files. [6]
Copy files to a Windows VPS over Remote Desktop
On a Windows VPS, the simplest way to move files is to share your own drives and clipboard with the Remote Desktop session. In Remote Desktop Connection, open the options before you connect, go to the Local Resources tab, select the Clipboard check box and choose the local drives you want to use. [7] In the session you can then open those drives and copy files between them and the server's own disks. [7]
If the drives or the clipboard do not show up, check the server's Group Policy. The policies Do not allow drive redirection and Do not allow clipboard redirection, under Remote Desktop Session Host > Device and Resource Redirection, take precedence over what you choose in the client. [7]
On a StealthRDP Windows VPS you have full Administrator access, so you can change these policies and install OpenSSH Server yourself.
Set up SFTP on a Windows VPS with OpenSSH Server
Install or enable OpenSSH Server, check its firewall rule, then connect with sftp or WinSCP. This route suits scheduled or scripted transfers, or times when you do not want to keep a Remote Desktop window open. Windows Server 2025 has OpenSSH installed but not enabled, while Windows Server 2022 needs it added first. [4]
1. Install or enable OpenSSH Server
Run the commands for your version in PowerShell as Administrator. [5] On Windows Server 2025 you can also open Server Manager, select Local Server and set Remote SSH Access to Enabled. [5]
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'2. Check the firewall rule
Setup creates and enables a firewall rule named OpenSSH-Server-In-TCP that allows inbound SSH on port 22. [5] Confirm that it exists:
Get-NetFirewallRule -Name 'OpenSSH-Server-In-TCP'With this rule enabled, anyone on the internet can try to sign in on port 22. Give every account that can sign in a strong password or an SSH key, and switch the SSH service off again when you no longer need it.
To switch it off, stop the service, set it to Disabled and disable the firewall rule. [5]
Stop-Service sshd
Set-Service -Name sshd -StartupType 'Disabled'
Disable-NetFirewallRule -Name 'OpenSSH-Server-In-TCP'3. Connect with sftp or WinSCP
From your computer, sign in with a Windows account on the server, such as Administrator:
sftp Administrator@203.0.113.10The first time, you are asked to confirm the server's key fingerprint, and answering yes adds the server to your list of known hosts. [5] After that, put and get work as they do with a Linux server, and WinSCP connects with the same address and account.
Keep transfers safe and check large files
Sign in with SSH keys, use encrypted protocols only, keep Windows file sharing off the internet and compare checksums after big copies.
- Use SSH keys instead of passwords. The command-line tools sign in through SSH, so the key you use for SSH works for file transfers too. [1] [2] Keep password logins for root switched off; our SSH hardening checklist shows how.
- Do not use plain FTP over the internet. In WinSCP's protocol comparison, SFTP and SCP are secured by SSH, while FTP is secure only when it runs over TLS/SSL. [6]
- Never expose SMB (port 445) to the internet. Mapping a network drive to your VPS may look handy, but Microsoft advises blocking inbound TCP port 445 from the internet. [8]
Verify large files with checksums
After a big upload or download, compare the SHA-256 checksum on both ends. On Linux, sha256sum prints a file's checksum, and its -c option checks files against a list it saved earlier. [9] In PowerShell, Get-FileHash uses SHA256 by default. [10] When the two hashes match, the files have the same content; Get-FileHash prints the hash in capital letters, so compare the characters and ignore the case. [10]
sha256sum backup.tar.gz
sha256sum backup.tar.gz > backup.tar.gz.sha256
sha256sum -c backup.tar.gz.sha256Get-FileHash backup.tar.gzrsync normally checks every file it transfers with a whole-file checksum, so this step matters most after scp, sftp, WinSCP or Remote Desktop copies. [3]
A transfer is not a backup. StealthRDP's weekly backups are for disaster recovery only, and our guide to automated VPS backups shows how to keep scheduled copies of your own.
FAQ
Is SCP deprecated?
The scp command is still part of OpenSSH. Since OpenSSH 9.0 it uses the SFTP protocol for transfers by default, and the old SCP protocol is used only when you ask for it with the -O option, for example for a server without SFTP support. [1]
What is the difference between SCP, SFTP and rsync?
All three run over SSH. scp copies files in a single command, while sftp opens an interactive session where you can browse folders and resume interrupted transfers. [2] rsync compares both sides and sends only what changed, which makes it the best fit for large folders and repeated copies. [3]
How do I transfer files to a Windows VPS?
The quickest way is Remote Desktop: on the Local Resources tab of Remote Desktop Connection, share the clipboard and your local drives before you connect. [7] For scripted or regular transfers, install OpenSSH Server on the VPS and connect with sftp, scp or WinSCP. [5]
Can I use rsync from Windows?
Not with the tools that come with Windows: its OpenSSH feature includes scp and sftp but not rsync. [4] rsync has to be installed on both ends of a transfer, so on Windows the simplest choices are scp, sftp or an SFTP client such as WinSCP. [3]
What port does SFTP use?
SFTP has no port of its own: it runs inside SSH, so it uses the server's SSH port. [2] On Windows Server, installing OpenSSH Server adds a firewall rule for inbound SSH on TCP port 22. [5] If your server listens on another port, pass it to scp or sftp with a capital -P. [1]
Sources & references
- scp(1) - OpenBSD manual pages — OpenBSD (accessed 2026-11-03)
- sftp(1) - OpenBSD manual pages — OpenBSD (accessed 2026-11-03)
- rsync(1) manpage — rsync (samba.org) (accessed 2026-11-03)
- OpenSSH for Windows overview — Microsoft Learn (accessed 2026-11-03)
- Get started with OpenSSH Server for Windows — Microsoft Learn (accessed 2026-11-03)
- Supported File Transfer Protocols — WinSCP (accessed 2026-11-03)
- Make Local Devices and Resources Available in a Remote Session — Microsoft Learn (accessed 2026-11-03)
- Secure SMB Traffic in Windows Server — Microsoft Learn (accessed 2026-11-03)
- sha256sum - compute and check SHA256 message digest — Ubuntu Manpages (Canonical) (accessed 2026-11-03)
- Get-FileHash — Microsoft Learn (accessed 2026-11-03)
Continue learning
VPS Control Panels and Management Tools: 6 Compared
Compare VPS control panels such as Plesk, cPanel, Webmin, Virtualmin and DirectAdmin on price, features and skill level, and learn how to choose one.
High Availability VPS: How to Design Automated Failover
Design a high availability VPS setup with redundancy, replication, automated failover and monitoring, and see how VPS and cloud compare for uptime.
Server Uptime Monitoring: 7 Tools to Compare
Compare server uptime monitoring tools, what to look for in alerts and checks, and when a self-hosted uptime monitor is enough.
