How to create password protected zip archive on ubuntu

By | March 5, 2013

Command Line

The zip command can be used to create password protected zip files easily. Here is a quick example

$ zip -P *secret* file.txt

Note that the P is capital. Can also type "--password" instead of the "-P".

$ zip --password *secret* file.txt

The above approach might be a bit insecure since the password is visible and the command is stored in the terminal history and can be retrieved. Another option is the e option which prompts user to enter the password.

$ zip -e file.txt
Enter password: 
Verify password:

The zip utility can be installed on ubuntu through apt-get

$ sudo apt-get install zip unzip

Password protect existing zip files

The above methods work well, but there is an easier way. First create a zip file using any of your favorite gui tools and then password protect it using the zipcloak command.

$ zipcloak 
Enter password: 
Verify password:

This is the quickest method since you don't have to remember any commandline parameters. Just the name of the command is enough.


There is a cross platform gui archive manager called Peazip which can be downloaded from

It is probably the most featureful gui archive manager available for Linux. With peazip you do not need the commandline/terminal and everything can be done from the gui interface very much like winzip on windows.

Last Updated On : 5th March 2013

Related Post

Leave a Reply

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