Unzip script password

archive, passwords, zip

Solution

Use the `-P` flag for password. From `man unzip`:

-P password
              use  password to decrypt encrypted zipfile entries (if any).  THIS IS INSECURE!  Many multi-user operating systems provide ways for any user to see the current command line of any other user; even on stand-alone systems there is always the threat of over-the-shoulder peeking.  Storing the plaintext password as
              part of a command line in an automated script is even worse.  Whenever possible, use the non-echoing, interactive prompt to enter passwords.  (And where security is truly important, use strong encryption such as Pretty Good Privacy instead of the relatively weak encryption provided by standard  zipfile  utili-
              ties.)

Problem

Ok here is my script ``` #!/bin/bash cd /var/backups/System/ unzip Themes.zip exit 0 ``` I need the script to put in the password automatically when unzipping the protected zip file which is the Themes.zip. Since the user don't know the password I need it to be enter through the script when extracting the zip archive. Hope this makes since?

Original source