Open In App

How to Create a Password Protected ZIP File in Linux?

Improve
Improve
Like Article
Like
Save
Share
Report

Linux provides Zip command to work with a file like compressing the file and decompressing with a password. It’s not come with built-in you need to install from an external source. The Zip command has two different utility(zip and unzip). zip is used for compressing the file and unzip is used for decompressing the file.

Installation

Use this command in Ubuntu, Debian, and Linux mint.

sudo apt install zip unzip

Installing Zip File Steup

For Arch Linux:

sudo pacman -S zip unzip

For Red Hat, Fedora, and CentOS.

sudo dnf install zip unzip

Usage

Zip the file with the following commands.

zip -re OUTPUT_FILE.zip FOLDER

While running this command it will ask the password for a zip file.

Example:

zip -re output_data.zip gfg

Check your file(output_data.zip) is created with password protected.

ls

Unzip

You can easily unzip the file with these commands.

unzip YOUR_FILE.zip

While running this command it will ask the password for a decompressing zip file.

Example:

unzip output_data.zip

Create a Password-Protected ZIP File in Linux Using GUI

We can use our GUI window to create a zip file and unzip too. Here are the following steps:

Step 1: Go to the file location and right-click on the file.

Create a Password-Protected ZIP File in Linux Using GUI

Step 2: Then click on the compress option.

Step 3: Then click on the other option and set your password and click on Create option.

Your Password-Protected ZIP File is created.


Last Updated : 23 Feb, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads