How do I give permission to unzip a file?

When unzipping files on Linux computers always check that group permissions are set to allow read, write, and execute access. The zip file format stores the permissions of the files and folders as they were set on the system where the zip file was created. If those permissions do not allow RWX access they will keep other member of your group fro accessing the files you extract in shared directories.

To fix them, right click on the folder you just extracted from the zip and set the permissions as shown here. Make sure you set Group Folder access to “Create and delete files”, then click on “Apply Permissions to Enclosed Files”, and finally “Close”.

How do I give permission to unzip a file?

It may seem counter intuitive but the group selected above is irrelevant. The PHHP file servers use Access Contol Lists or ACLs to set permissions. Those settings aren’t reflected in this dialog box.

Fix Permissions on the Command Line

You can also fix the permissions on the command line. Open a shell, cd to the place that has the problem and run a command like this:

chmod -R 775 folder/

What if I don’t own the file?

If you are not the person who extracted the file, neither of these techniques will work. This is a fix the owner of the file– the person who extracted it–should use. If the permission change wasn’t done by the owner, call or email PHHP IT. If you can send the full path to the problem directory that will expedite repairs.

I don't use these programs (or much else) on
Windows, but I believe that this is the
permission/protection information in the
archive:

> non-MSDOS external file attributes: 000000 hex

If that's all it gets, then UnZip will try to
use it when extracting that file. I'd guess
that that's why an extracted file gets
all-zero permissions ("---------") on the
HP-UX system.

> Then zip all the files [...]

Another invisible command, but if the files
were extracted with all-zero permissions,
then Zip would normally record those
permissions in the new archive, which would
explain this:

> Unix file attributes (000000 octal): ?---------

If you use Zip on a file with more usual
permissions, then you should get more usual
results. For example:

dyi # ls -l vat.c
-rw-r--r-- 1 root sys 80 Mar 6 2008 vat.c
dyi # /usr/local/bin/zip fred.zip vat.c
adding: vat.c (deflated 11%)
dyi # /usr/local/bin/unzip -Zv fred.zip | grep attributes
Unix file attributes (100644 octal): -rw-r--r--
MS-DOS file attributes (00 hex): none

"rw-r--r--" = 0644.

So, it appears that the program which creates
your original archive is storing unfriendly
permission info in the archive. Then UnZip
uses that permission info when you extract
the files on HP-UX, so you get files on HP-UX
with unfriendly permission info. Zip then
preserves the unfriendly permission info when
you make your new archive on HP-UX.

I don't see anything in the help for Zip or
UnZip which would let you ignore the actual
or archived permission info, so, if you get
unfriendly permission info in the original
archive, then you may need to change the
permissions on the HP-UX files before using
Zip to make the new archive.

man chmod

We have had some discussion recently about
adding some UnZip option(s) to allow better
permission control when extracting files,
but so far it's only talk. So far as I know,
all UnZip has now is "-X", which would not
help in this case.

  • I logged in with root in root group. My web process (Apache 2.4) runs as www-data in www-data group.

    After unzip the .zip package to /var/www/html/. All files are 644 with root:root ownership. All directories are 755 with also root:root.

    After reading tons of articles and posts, finally I decide to set the ownership of all WordPress things to www-data:www-data before configuration and install. Otherwise, WordPress may not be able to write wp-config.php.

    Site is successfully created and I am able to install Plugins. Then, to harden permissions, I use chown root:root -R *. Files are 644 and directories are 755.

    Then, it becomes unable to install or delete plugins. A Connection Information dialog shows up (I am using SSH not FTP. So I install php-ssh2 to enable its SSH2 option. It seems to logged in but shows ‘Unable to locate WordPress content directory (wp-content).’ when install or delete plugins).

    Someone suggests on SO that chown www-data:www-data ./wp-content (with no -R option) is also needed, I am not sure and try that with no help.

    I am wondering if there is a way that I can secure my website as well as allowing me to install new plugins. Please help me.

    P.S

    I am familiar with Linux permissions and ownership for directories and files and the corresponding commands.

  • Why wont it let me unzip a file?

    Zip files may refuse to open if they are not properly downloaded. Also, incomplete downloads occur when files get stuck due to issues like bad internet connection, inconsistency in network connection, all of which can cause transfer errors, affect your Zip files, and make them unable to open.

    How do I give permission to a zip folder?

    3] Get special permissions to the contents of the ZIP If there's a ZIP folder in there, right-click on it and select Properties. In the Properties window, navigate to the Security tab. Select your user account from the Group or user names box and confirm that you have Allow privileges for Special permissions.

    How do I allow permission to access a file?

    Granting Access to a File or Folder.
    Access the Properties dialog box..
    Select the Security tab..
    Click Edit. ... .
    Click Add... ... .
    In the Enter the object names to select text box, type the name of the user or group that will have access to the folder (e.g., 2125. ... .
    Click OK. ... .
    Click OK on the Security window..