I have a script that runs regularly via cron, that creates a tar.gz file for the purpose of backing up a directory.For reasons beyond my control, the only user who can execute the script via cron is a root user. So the resulting tar file can not be moved or deleted by any other user.So, as part of the script, I want to execute a chown and chmod on the tar file so that other users can manipulate it.But is it good enough to just change permissions on the tar file, or will the root user permissions also be saved to the files inside the tar? When a user unpacks the tar file, will they be able to act on those files as if they created the files themselves?
If I change permissions on a tar file, will that apply to the files inside it?
permissions;tar;chmod;chown
If the user extracting is a ordinary user, the files will be owned by that user (by default).From the manual page of tar--same-owner       try extracting files with the same ownership as exists in the archive (default for superuser)--no-same-owner       extract files as yourself (default for ordinary users)