I'm not familiar with sftp, but the cause is probably a unit difference: du
shows size in MiB while sftp might show Mb. To convert from one to the other, multiply the size given by sftp by 1000*1000/(1024*1024)
(87 -> ~83).
Wikipedia page on the subject : https://en.wikipedia.org/wiki/Byte#Multiple-byte_units
Note that if you transfer very small files, you might some day notice that du
shows a greater size than expected. This is because du
shows the reserved size of the files on disk, which is greater than the actual 'usefull' size that is calculated by sftp.
Edit: to test this behavior, you can create a file with a controlled size and tranfer it. To create a 32 MiB (~33MB) file:
# 1048576 is 1 MiB (1024*1024)
dd if=/dev/zero bs=1048576 count=32 of=testfile