Christopher Shaw
Christopher Shaw

Reputation: 734

How to extract a tar while ignoring permissions

I am transferring a tar file between two servers and extracting when it is received. The issue I am having is that the permissions are being retained and applied on the target server causing permission issues.

Is there a way to extract a tar file with ignoring the original permissions of the files it is extracting.

Upvotes: 10

Views: 12522

Answers (2)

iwl
iwl

Reputation: 109

--no-same-permissions seems to "and" the umask, so even less permissions then in the tar.

Upvotes: 3

coredump
coredump

Reputation: 41

The default options for tar command on CentOS-7.2 includes --no-same-permissions

The output from tar manual includes the following:

--no-same-permissions
 apply the user's umask when extracting permissions from the archive (default for ordinary users)

Upvotes: 1

Related Questions