LINUX, FOSS AND LIBRARY TECHNOLOGY ENTHUSIAST

Friday, February 14, 2020

How to Create a Password Protected Zip file in Linux

0 comments
There are several ways you can encrypt zip files in Linux. In fact, there are dedicated command line tools for this task but I am not going to talk about those. I am going to show you how to password protect a zip file without installing a dedicated tool. To Create password protect zip file in Linux 

Command Line Method
First thing first, make sure that you have zip support enabled in your Linux system. Use your distribution’s package manager and try to install it. If it is not installed already, it will be installed.

In Debian/Ubuntu, you can use this command:

sudo apt install zip unzip

Now, let’s see how to password protect a zip file in Linux. The method is almost the same as creating a zip folder in Linux. The only difference is the use of option -e for encryption.

sudo zip -re output_file.zip file1 folder1

The -r option is used to recursively look into directories. The -e option is for encryption.

You’ll be asked to enter and verify the password. You won’t see the password being typed on the screen, that’s normal. Just type the password and press enter both times.

Do note that if someone tries to unzip this file, he/she can see the content of the folder such as which files are there in the zipped file. But the files cannot be read.

GUI Method
Step 1:
Search for Archive Manager and open it.

Step 2:
Drag and drop the file(s) you want to compress into a zip file. Select Create Archive option here.

Step 3:
Here, choose the type of compressed file. It will be .zip in my case. You’ll see the “Other Options”, click on it and you’ll see the password field. Enter the password you want and click on the Save button.

That’s it. You have successfully created a password-protected zip file in Debian/Ubuntu Linux graphically. The next time you want to extract it, it will ask for a password.

No comments:

Post a Comment