Sometimes I want to transfer files including ownership. This is not possible as normal user as the chown(2)
system call requires special privileges, that is: uid == 0
. However, I do not want to open ssh access for root, but go with the usual way to elevate my privileges: sudo.
I will go through common solutions presented on the web and explain why these do not work at all without significant modifications on the remote host and then present a working solution using X11-Forwarding that is less invasive.