What are the reasons that could make a change in a file ownership after
scp'ing it from one server to another?
The file ownership changed from 'owner' to 'apache'.
scp -p .
The user 'owner' exists on both servers and has the same UID.
You can see the
If you want to preserve file ownership, you can use
When you scp, the ownership comes from the user you use to scp to the other machine. For example:-
The ownership of FILENAME at the host HOSTNAME after scp will be USER as owner and primary group of USER as its group ownership.