0

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?

LonnieBest
  • 1,450
  • 4
  • 21
  • 36

2 Answers2

1

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 http://www.chiark.greenend.org.uk/~sgtatham/putty/.

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]

Matt
  • 34
  • 1
  • 1
    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 06 '12 at 07:19
0

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.

mdpc
  • 11,698
  • 28
  • 51
  • 65