I hope this isn't FAQ but I can't find an answer for this: If a file named /a/some_file is in Unix machine 'A' and it's owned by user 'someuser', if I run 'scp -p root@A:/a/some_file another_file', I expected the permissions, timestamp, owner and group of the file to be the same as the target_file. The timestamp and permissions are correct but the owner becomes root instead of 'someuser'. I'm not sure if this is a bug but I know some older versions of ssh keep the owner and the group of the file. Thanks!
This behaviour is by-design: scp doesn't try to change the ownership of files that it copies. Why? The simple answer is that rcp didn't and scp is rcp-over-ssh. A better explanation would probably be that the owner user on the local host is not guaranteed to exist on the remote host. In any case, the behaviour won't be changing as it has too many consequences. If you want to preserve ownership, use tar-over-ssh (its faster too). (Sorry for the long delay in answering, but I just noticed this bug)
Mass change of RESOLVED bugs to CLOSED