Shared server guidance · Question & answer

How do I upload a file from Windows to a Linux server?

Run scp on your Windows computer with the local file first and the remote destination second. Upload to a directory your account can write, then verify the file before using it in an application.

BeginnerWindows 11 with Microsoft OpenSSH Client; Windows PowerShell 5.1 or PowerShell 7 as labelledLinux VPS and dedicated servers where a remote Linux command is shown
Go to the answer

Instructions

1. Check the local source

Confirm the exact file and size. Relative paths are resolved from the current Windows directory.

Local Windows PowerShell
Get-Item -LiteralPath ".\report.txt" | Select-Object FullName, Length

Use a real existing source file. This command reads its metadata without uploading it.

2. Upload to the account’s home directory

Choose a filename that will not replace an existing file you need.

Local Windows PowerShell
scp ".\report.txt" adminuser@203.0.113.10:report-upload.txt

The same command works in CMD. The remote path after the colon is relative to the account’s home directory.

3. Verify remotely

Check the target file from an SSH session before passing it to any application.

Remote Linux shell
ls -l "$HOME/report-upload.txt"
sha256sum "$HOME/report-upload.txt"

Confirm size, ownership and content hash. Compare the hash with a local SHA256 calculation when integrity matters.

Check the result

  • SCP exits successfully and the intended remote file exists.
  • The size and, where checked, SHA256 hash match the source.

Troubleshooting

Permission denied on the destination
Use an account-owned staging directory instead of weakening a protected application path.
No such file on Windows
Check the current directory and quote paths containing spaces.

Official references

Use the documentation for your installed version when a flag, service name or platform feature differs.