In a GNU/Linux OS there is no way to change ownership of a file until you are root. But what if I want to hide my systems username e.g. before sending a file to someone, because some things like tar will try to keep it? What I think about is something like# mkdir --mode=????? /tmp/nobodysfiles# chown nobody:nobody /tmp/nobodysfiles$ whoamipopcorneater$ ls -l ~/file-rw-r--r-- 1  popcorneater popcorneater 12345 oct.  18 11:10$ cp ~/file /tmp/nobodysfiles/$ ls -l /tmp/nobodysfiles/file-rw-r--r-- 1 nobody nobody 12345 oct.  18 11:11
How to create a folder which will change its contents ownership to what the folder has?
files;tar;chmod;chown
Prepare your archive inside a fakeroot session. Fakeroot was designed precisely to prepare a directory structure's ownership and permissions before building an archive.fakeroot bashchown -R root:root nobodysfilestar czf nobodysfiles.tgz nobodysfiles