Operating System - HP-UX
1748208 Members
2696 Online
108759 Solutions
New Discussion юеВ

Re: scp corrupting the files

 
SOLVED
Go to solution
KathyK
Regular Advisor

scp corrupting the files

Hi experts,

One of our programers was using scp to copy a file from Malaysia to our us office, the file came over showing the same size but was corrupted. here is the details:

both systems are running

HPUX 11.23
rp7420


the file is 2MB, some where in the middle of the file that's recieved around 2000 lines get dropped and replaced with null character.

If anyone knows of any problem with SCP please reply.

Always greatfull


Kathy
17 REPLIES 17
Dennis Handly
Acclaimed Contributor

Re: scp corrupting the files

I've had corruption over NFS before. I was able to find the problem and related it to a block size issue.

You can use "xd -tx4 -tc file" to produce a dump. Then diff this with a dump from the original file.

If the data then resyncs, you may have to use an editor to remove the xd offsets from the beginning of each record.
Armin Kunaschik
Esteemed Contributor
Solution

Re: scp corrupting the files

I never had such a corruption... if scp returned with return code 0.
You did check the return code after copying?

You did not say anything about the SSH version on source and destination.
A first try is to update to a current version on both sides if availabe.

If this does not help, you should consider generating md5 checksums (get the md5sum depot from http://www.software.hp.com/) and check them after transmission.

My 2 cents,
Armin
And now for something completely different...
KathyK
Regular Advisor

Re: scp corrupting the files

Thank you both for good information, i'm going to test the checksum and compare that.

OpenSSL -> A.00.09.07e.0 Secure Network Communications Proto


Regards,
Kathy
rick jones
Honored Contributor

Re: scp corrupting the files

Unless there is no actual encryption happening with the scp, that such a large corruption came through the scp suggests that the sending scp was given bogus data. GIGO - Garbage In Garbage Out.

Still, if it isn't already you might consider disabling CKO (ChecKsum Offload) on the NICs on either side.

And if those 2000 lines were perhaps in some way "subversive" as far fetched as it sounds you might consider looking for a "man in the middle" situation.
there is no rest for the wicked yet the virtuous have no pillows
KathyK
Regular Advisor

Re: scp corrupting the files

Rick,

thanks for the response. could you please explain how to disable the CKO on the nic card?

Thanks
rick jones
Honored Contributor

Re: scp corrupting the files

If we are talking about GbE cards rather than 10GbE cards, IIRC it is already disabled in 11.23 and 11.31. However, if I am remembering correctly, it would be a lanadmin kind of thing. I also think that if CKO is enabled, it will appear as one of the flags in the output of ifconfig.

Also, unless you can reliably reproduce the corruption, all of this is going to be blind shots in the dark.
there is no rest for the wicked yet the virtuous have no pillows
KathyK
Regular Advisor

Re: scp corrupting the files

That's the problem, this happends in random. and I have not been able to re-produce the problem yet. but i'll keep working on it.

thanks
Kathy
Dennis Handly
Acclaimed Contributor

Re: scp corrupting the files

>this happens in random. and I have not been able to re-produce the problem yet.

Were you able to look at a hex dump and see if the corruption was on nice block boundaries?
KathyK
Regular Advisor

Re: scp corrupting the files

Dennis,
I looked at it briefly but need to go back to it. I'm installing the md5 package on my servers now.
thanks