Shared server guidance · Question & answer

How do I verify that a file transferred correctly?

Calculate SHA256 for the source and destination and compare the complete values. A matching digest gives strong evidence that the bytes are the same. It does not by itself establish who created the file or whether its contents are safe.

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. Hash the local Windows file

Use a literal path to avoid wildcard expansion and name the algorithm explicitly.

Local Windows PowerShell
Get-FileHash -LiteralPath ".\package.dat" -Algorithm SHA256

Read the Hash value. Windows often displays hexadecimal letters in uppercase.

2. Hash the corresponding Linux file

Run this after the transfer finishes, using the actual remote destination path.

Remote Linux shell
sha256sum "$HOME/package.dat"

GNU sha256sum prints the digest and filename. Hexadecimal letter case does not change the value.

3. Compare the same stable content

Compare the full digest, not just a prefix. Make sure neither file is being changed while you measure it. When checking a downloaded software package, obtain the expected checksum or signature through the publisher’s trusted channel, not only from the same untrusted download source.

Check the result

  • Both digests use SHA256 and match across all characters.
  • The measured files are the intended source and destination, with transfer complete.

Troubleshooting

The digests differ
Check for the wrong file, a partial transfer, a changed source or line-ending conversion.
The filenames differ but hashes match
Renaming does not change content; assess whether that was the intended destination name.

Official references

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