Unable to transfer file bigger than 4KB using ssh

Hi Community,

I’m trying to send a file to a nerves devices using scp command. However when i send the file bigger than 4KB data is corrupted, in the sense, if a text file is transferred say of size 4100 bytes, then last 4 characters are only present in file first 4096 characters are lost, we can say it’s like rollover or overwriting.
I tireif changing the MTU as well still it didn’t work, currently MTU on both host and target is 1500.

Anyone encountered similar issue?
Or if anyone know how to transfer file to nerves system over local network?

Thanks & Regards

I’ve been transfering files to nerves systems using an ssh client (not scp specifically) for a long time without ever encountering anything similar. It sometimes didn’t work at all if things were somehow configured or started incorrectly.

Could you try using sftp? I know that it works well. It sounds like there’s an issue with scp support which would be nice to fix, but not sure what.

I can confirm that transferring files via sftp works absolutely flawlessly. We transfer lots of images and videos this way and never encountered any issues.

Absolutely, we had a project running for years that was ingesting data exclusively from SFTP and FTP servers.

We had a problem though back when I migrated the system to use sftp from OTP back in the day. The client would hang without any errors or warnings at random times for some servers. I investigated that issue back in the day and the only logical solution I found is that some of those servers were implementing some parts of the protocol incorrectly.

This is not something new and clients in this case (for example sftp that you have by default in linux) have overcame them by fixing these edge-cases over time. In the case you can control the sftp server, this should not be a problem that you can’t deal with.