Skip to content

Transferring files from Windows to a Linux server#

This page used to describe a roundabout method involving rdesktop - which is a tool for connecting a desktop session from Linux to Windows, not for transferring files. What you actually need today is much simpler: one of four SSH-based methods.

Which method should I use#

Situation Method
I want to drag and drop a handful of files WinSCP
I need to copy a single file from a script or automation scp (PowerShell, built in)
I need to sync a large folder repeatedly, only the changed parts rsync (via WSL)
I already connect to the server with VS Code The Remote - SSH extension's file explorer

All four assume you can already SSH into the server. If not, set up an SSH key first - the panel's Settings > SSH Keys section, or the SSH Key Management section on the Security page, walks through it. It is both faster and safer than typing a password every time.

Method 1: WinSCP (the easy way)#

  1. Download and install from winscp.net.
  2. New Session: Host name = your server's IP, Port = 22, User name = your user.
  3. If you use an SSH key, select your .ppk file under Advanced > SSH > Authentication (convert an OpenSSH-format key to .ppk with PuTTYgen first).
  4. Connect. The left pane is Windows, the right pane is the server - drag and drop works.

Interface preference

WinSCP's Commander mode (two panes side by side) is faster for most people than Explorer mode - familiar if you are used to a classic dual-pane file manager.

Method 2: scp / sftp (built in, script-friendly)#

Windows 10 has shipped the OpenSSH client since version 1809 - nothing extra to install. Open PowerShell:

# Upload a single file
scp C:\Users\you\report.zip user@server-ip:/home/user/

# Upload a folder
scp -r C:\Users\you\project user@server-ip:/home/user/

# Download from the server
scp user@server-ip:/var/log/nginx/error.log C:\Users\you\Desktop\

The direction always reads the same way: source first, destination second. If your SSH key is in the default location (C:\Users\you\.ssh\id_ed25519) you do not need to specify it; otherwise add -i C:\path\to\key.

With Morpheus

"show me the last 200 lines of /var/log/nginx/error.log"

Morpheus can read the file without you going to the server - a quick look at a log does not need a transfer. Actual file transfer (upload/download) stays outside chat by design: letting a conversation write arbitrary files crosses a security boundary it should not.

Method 3: rsync (via WSL, for large or repeated syncs)#

rsync sends only what changed - if one file in a 10 GB folder was modified, it does not pull all 10 GB again. It is not built into Windows; use it through WSL (Windows Subsystem for Linux).

wsl --install    # once, if WSL is not already installed

From inside WSL:

rsync -avz --progress /mnt/c/Users/you/project/ user@server-ip:/home/user/project/

-a preserves permissions and timestamps, -v gives verbose output, -z compresses the transfer. The trailing / matters: project/ copies the folder's contents, project without the slash puts the folder itself inside the destination.

Method 4: VS Code Remote - SSH#

If you already connect to your server with VS Code, you do not need a separate tool - the Explorer panel on the left is the server's file system directly, and drag-and-drop from Windows Explorer works.

Troubleshooting#

"Permission denied (publickey)" - your key is not in the server's ~/.ssh/authorized_keys, or you are connecting as the wrong user. Check the SSH Keys tab for your server in the panel.

"REMOTE HOST IDENTIFICATION HAS CHANGED" - the host key changes if the server was reinstalled or its IP changed, and that is normal. Clear the old entry with ssh-keygen -R server-ip and reconnect - but only do this if you made the change yourself; an unexpected warning can also be a genuine MITM signal.

scp is very slow - the cipher may be an old one; try -c aes128-gcm@openssh.com, or switch to rsync for anything repeated.

Checklist#

  • [ ] You can connect with your SSH key without a password prompt
  • [ ] WinSCP or scp chosen for small/one-off transfers
  • [ ] rsync chosen for large or repeated syncs
  • [ ] If you got a host key warning, you confirmed it was your own change first