Cara Mem Password atau Mem Protected ZIP File in Centos 7

Password Protected ZIP File in Linux

Create an encrypted ZIP file from some file:

$ zip --encrypt file
Enter password: 
Verify password: 
  adding: file (deflated 8%)

Create password protected ZIP archive from the several files:

$ zip --encrypt file1 file2 file3
Enter password: 
Verify password: 
  adding: file1 (stored 15%)
  adding: file2 (deflated 30%)
  adding: file3 (deflated 45%)

Create an encrypted ZIP archive from a folder /var/log/:

$ zip --encrypt -r /var/log/
Enter password: 
Verify password: 
  adding: var/log/ (stored 0%)
  adding: var/log/dmesg.0 (deflated 74%)
  adding: var/log/dpkg.log.9.gz (deflated 0%)
  adding: var/log/samba/log.asc-nb (deflated 96%)

Use the following command to uncompress a ZIP file:

$ unzip
Enter password:

Encrypt and Decrypt ZIP Archive in Linux

You were interactively prompted for the password in the examples above.

If you want to create a password protected ZIP file from some shell script, you may want to do it non-interactively.

You can easily encrypt and decrypt ZIP files from the Linux command line without being prompted for the password.

Do it as follows:

$ zip -P passw0rd file
$ zip -P passw0rd file1 file2 file3
$ zip -P passw0rd -r /var/log/

Uncompress a password protected ZIP archive:

unzip -P passw0rd

Refferensi :

Leave a Reply

Your email address will not be published. Required fields are marked *