Since 2016 · 50,000+ customers · ★ 5.0 on Google Live chatWhatsAppTelegramOpen a ticket
Get started
Linux

How to Transfer Files Between Two Linux Servers (WinSCP, scp, rsync)

How to transfer files between Linux servers guide by 99RDP

WinSCP is a popular Windows app for moving files to and from a Linux server. But it can't copy files directly from one remote server to another: it downloads them to your PC and uploads them again, which is slow for large data. This guide shows how to do server-to-server transfers properly, with WinSCP when you need a GUI, and with rsync and scp straight between the servers.

Quick answerSSH into the source server and push the files to the destination:

rsync -avzP /var/www/ user@203.0.113.20:/var/www/

This copies directly between the servers, shows progress, and can be resumed.

rsync -avzP copying files from one Linux server to another with progress output
Copying files server to server with rsync

rsync only transfers what changed, preserves permissions and timestamps, and can resume.

# on the source server
rsync -avzP /data/ user@destination:/data/
# pull instead, from the destination server
rsync -avzP user@source:/data/ /data/
# custom SSH port
rsync -avzP -e "ssh -p 2222" /data/ user@destination:/data/
  • -a keeps permissions, owners and timestamps; -v lists files; -z compresses; -P shows progress and allows resuming.
  • A trailing slash on the source (/data/) copies its contents; without it, rsync creates a data folder inside the destination.
  • Add --dry-run to preview, and --delete to make the destination an exact mirror (it removes extra files there).

Both servers need rsync installed (sudo apt install rsync or sudo dnf install rsync).

Diagram comparing a direct server-to-server copy with rsync or scp against copying through your PC with WinSCP
Direct or through your PC

Option 2: scp

scp -r /var/backups user@destination:/var/backups      # from source to destination
scp -3 -r user@source:/data user@destination:/data      # from your PC, between two servers

scp -3 routes the data through the machine you run it on, like WinSCP does, which is handy when the two servers can't reach each other directly.

Option 3: WinSCP (GUI, through your PC)

WinSCP is a Windows program (there's no Linux version; on Linux use FileZilla or the terminal). To move files between two servers with it:

  1. Open WinSCP and log in to the source server (SFTP, port 22 or your custom port).
  2. Download the files to a local folder in the left pane.
  3. Open a second session (Tabs → New Tab or Ctrl+N) to the destination server.
  4. Upload the files from the local folder.

For large transfers, use WinSCP only to start the job: open its built-in terminal (Commands → Open Terminal) or PuTTY on the source server and run the rsync command from Option 1, so the data goes straight between the servers.

Diagram of copying between two servers with WinSCP: data passes through your PC; scp on the server copies directly
Copying between servers

Set up SSH keys for passwordless transfers

For repeated or scheduled transfers, let the source server log in to the destination with a key:

# on the source server
ssh-keygen -t ed25519
ssh-copy-id user@destination
ssh user@destination      # should log in without a password

Then schedule rsync with cron, for example a nightly sync at 02:00:

0 2 * * * rsync -az /data/ user@destination:/data/ >> /var/log/rsync-data.log 2>&1

Large transfers: keep them running

Start long transfers inside tmux or screen so they continue if your SSH session drops, and use rsync's -P so you can resume an interrupted copy by running the same command again.

Frequently asked questions

Can WinSCP transfer files between two remote servers?

Not directly. It downloads to your PC and uploads again. For direct transfers, run rsync or scp on one of the servers.

What is the fastest way to copy files between Linux servers?

rsync over SSH, run directly on one of the servers. For huge numbers of small files, compressing them with tar first can be faster.

Is there WinSCP for Linux?

No, WinSCP is Windows-only. On Linux, use FileZilla, the file manager's "Connect to Server" (sftp://), or rsync and scp.

How do I copy a folder to another server in Linux?

Use rsync -avzP /folder/ user@server:/folder/ or scp -r /folder user@server:/path/.

Nishant Kumar, Sr. Server Engineer at 99RDP
Written byNishant KumarSr. Server Engineer, 99RDP. Part of the team that runs our servers and answers support.
Keep reading

More Linux guides

All Linux guides

Need a server for this?

✓ Setup in minutes✓ Full admin access✓ 7-day refund on new services