Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Each time I download a big file over sftp, the md5sum on the source machine doesn't match the md5sum I do on the destination machine.

I have a 13gig file on an Ubuntu 12.04 machine with openssh-server running.

I used FileZilla to download that file to my laptop over sftp. However, the file isn't exactly the same after the download completes.

Perhaps the FTP protocol isn't the best choice? Without an external hard-drive handy, what the most certain way I can transfer this file and be certain that the copy I get is exact?

share|improve this question
FTP is not SFTP. – Ignacio Vazquez-Abrams Aug 6 '12 at 4:09
Are you sure it is at all related to the size? Have you tried a small file (like 100mb)? If it also fails then you make a GREAT job listing misleading elements in your question. – TomTom Aug 6 '12 at 4:14
You can use rsync to fix any discrepancies in the file. Just make sure you run it in the right direction! – David Schwartz Aug 6 '12 at 4:17
@Ignacio: sFTP IS FTP (over ssh); the ftp protocol is still used in sFTP. And, as protocol I don't believe it makes much effort in ensuring a download is exact; the larger the file, the less likely it is to be exact. – LonnieBest Aug 6 '12 at 4:28
You're thinking of FTPS, which is FTP over SSL. SFTP is a completely different protocol. – Ignacio Vazquez-Abrams Aug 6 '12 at 4:32
up vote 1 down vote accepted

SFTP can actually still suffer from potential issues related to ASCII/binary transmission modes, etc.; I recommend using SCP (Secure Copy, via SSH) instead. If your destination machine is a Windows machine, one of the best clients -- also free -- is the PuTTY binary pscp.exe from

To copy from the source to destination using pscp.exe, open a Windows command prompt to the location where pscp.exe is saved, and run the following:

pscp.exe [username]@[remote-machine]:[path-to-file] [local-save-location]

share|improve this answer
I understand the distinction between SFTP and FTPS. Nevertheless, anecdotally, I have still encountered transfer issues on occasion using SFTP, and therefore recommend SCP for a guarantee of file integrity. – Matt Aug 6 '12 at 7:19

I agree that I believe that for some reason you are running ASCI transfer mode between the two machines. The line terminators between Windows type machines and UNIX based machines are different, and transfer in ASCI mode causes an automatic line termination conversion.

Running in BINARY mode, makes no translation whatsoever. SFTP I believe has ONLY a binary transfer mode.

There of course is a caution, the content may be interpreted different despite the checksum if you are attemmpting to transfer Windows TEXTUAL material to Linux (and visa versa). Some editors however take care of these line termination details automagically but NOT all.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.