- How to Create a Password Protected Zip File in Linux
- Create password protect zip file in Linux [Command Line Method]
- How To Password Protect A Folder In Linux
- Create a password protected zip file in Linux [GUI Method]
- Step 1:
- Step 2:
- Step 3:
- Step 1
- Step 2
- Step 3
- Step 4
- How to Create a Password Protected ZIP File in Linux
- How to Create Password Protected ZIP in Linux
- How to Unzip Password Protected ZIP in Linux
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- How to Create a Password Protected ZIP File in Linux?
- Installation
- Usage
- Unzip
- Create a Password-Protected ZIP File in Linux Using GUI
How to Create a Password Protected Zip File in Linux
Last updated October 29, 2020 By Abhishek Prakash 13 Comments
Brief: This simple tutorial shows you how to create a password protected zip file in Linux both in command line and graphical way.
We have seen how to password protect folders in Ubuntu earlier. We have also seen encrypted text editor for Linux. Today, we’ll see how to create password protected zipped files in Linux, in both command line and graphical way.
I am using Ubuntu in this tutorial but you can use any Linux distribution that uses Nautilus (now called Files) file manager for the graphical part. Command line steps are the same for any Linux distribution.
There are several ways you can encrypt zip file 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.
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 its not installed already, it will be installed.
In Debian/Ubuntu, you can use this command:
Now, let’s see how to password protect a zip file in Linux. The method is almost the same as creating zip folder in Linux. The only difference is the use of option -e for encryption.
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.
Here’s what the process looks like on the screen:
zip -re my_zip_folder.zip agatha.txt cpluplus.cpp test_dir
Enter password:
Verify password:
adding: agatha.txt (deflated 41%)
adding: cpluplus.cpp (deflated 4%)
adding: test_dir/ (stored 0%)
adding: test_dir/myzip1.zip (stored 0%)
adding: test_dir/myzip2.zip (stored 0%)
adding: test_dir/c.xyz (stored 0%)
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.
Recommended Read:
How To Password Protect A Folder In Linux
Have secrets? Keep them safe by locking folders with password in Linux.
Create a password protected zip file in Linux [GUI Method]
I have created a password protected zip file in Ubuntu 18.04 here but you can use the same steps on any Linux distribution with GNOME desktop environment.
Step 1:
Search for Archive Manager and open it.
» data-medium-file=»https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/archive-manager-ubuntu.jpg?fit=300%2C86&ssl=1″ data-large-file=»https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/archive-manager-ubuntu.jpg?fit=800%2C230&ssl=1″ loading=»lazy» width=»800″ height=»230″ src=»https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/archive-manager-ubuntu.jpg?resize=800%2C230&ssl=1″ alt=»Archive Manager Ubuntu» srcset=»https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/archive-manager-ubuntu.jpg?w=800&ssl=1 800w, https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/archive-manager-ubuntu.jpg?resize=300%2C86&ssl=1 300w, https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/archive-manager-ubuntu.jpg?resize=768%2C221&ssl=1 768w» sizes=»(max-width: 800px) 100vw, 800px» data-recalc-dims=»1″/> Archive Manager
Step 2:
Drag and drop the file(s) you want to compress into a zip file. Select Create Archive option here.
Create a zip file
» data-medium-file=»https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-archive-ubuntu-1.jpg?fit=300%2C184&ssl=1″ data-large-file=»https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-archive-ubuntu-1.jpg?fit=800%2C491&ssl=1″ loading=»lazy» width=»800″ height=»491″ src=»https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-archive-ubuntu-1.jpg?resize=800%2C491&ssl=1″ alt=»Create Archive Ubuntu 1″ srcset=»https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-archive-ubuntu-1.jpg?resize=800%2C491&ssl=1 800w, https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-archive-ubuntu-1.jpg?resize=300%2C184&ssl=1 300w, https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-archive-ubuntu-1.jpg?resize=768%2C471&ssl=1 768w, https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-archive-ubuntu-1.jpg?w=1053&ssl=1 1053w» sizes=»(max-width: 800px) 100vw, 800px» data-recalc-dims=»1″/> Create a zip file
Step 3:
In 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.
Create Password Protected Zip file
» data-medium-file=»https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-password-protected-zip-ubuntu.jpg?fit=300%2C182&ssl=1″ data-large-file=»https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-password-protected-zip-ubuntu.jpg?fit=800%2C485&ssl=1″ loading=»lazy» width=»800″ height=»485″ src=»https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-password-protected-zip-ubuntu.jpg?resize=800%2C485&ssl=1″ alt=»Creating Password Protected Zip file in Ubuntu Linux» srcset=»https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-password-protected-zip-ubuntu.jpg?resize=800%2C485&ssl=1 800w, https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-password-protected-zip-ubuntu.jpg?resize=300%2C182&ssl=1 300w, https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-password-protected-zip-ubuntu.jpg?resize=768%2C465&ssl=1 768w, https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/01/create-password-protected-zip-ubuntu.jpg?w=1046&ssl=1 1046w» sizes=»(max-width: 800px) 100vw, 800px» data-recalc-dims=»1″/> Create Password Protected Zip file
That’s it. You have successfully created a password protected zip file in Ubuntu Linux graphically. The next time you want to extract it, it will ask for a password.
» data-medium-file=»https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/password-protected-zip-ubuntu.jpg?fit=300%2C176&ssl=1″ data-large-file=»https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/password-protected-zip-ubuntu.jpg?fit=800%2C469&ssl=1″ loading=»lazy» width=»800″ height=»469″ src=»https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/password-protected-zip-ubuntu.jpg?resize=800%2C469&ssl=1″ alt=»Password Protected Zip file in Ubuntu» srcset=»https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/password-protected-zip-ubuntu.jpg?resize=800%2C469&ssl=1 800w, https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/password-protected-zip-ubuntu.jpg?resize=300%2C176&ssl=1 300w, https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/password-protected-zip-ubuntu.jpg?resize=768%2C451&ssl=1 768w, https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/01/password-protected-zip-ubuntu.jpg?w=852&ssl=1 852w» sizes=»(max-width: 800px) 100vw, 800px» data-recalc-dims=»1″/> Password Protected Zip file in Ubuntu
If you are using Ubuntu 16.04 with Unity desktop environment, things will be slightly different. Click on the next section to see the steps for Unity desktop.
To follow this tutorial, you just need to make sure that you are using Nautilus/Files file explorer. If you are using Fedora, Ubuntu Unity, or any other Linux distribution with GNOME as its desktop environment, you have Nautilus.
Step 1
Right click on file(s) and/or folder(s) and click on Compress:
Select the compression format you want to choose. There are several formats available but you cannot use all of them for password protecting the files.
Step 2
I advise to use the .zip format. After selecting the compression format, click on the Other Options.
Step 3
You’ll see option of entering password in Other Options. If the compression format you selected doesn’t support encryption, this Password area would be greyed out.
It may also happen that you’ll have to install the compression utility to use the encryption. For example, if you do not have RAR installed, password option will not be available.
Step 4
Enter a suitable password and click on Create:
Compression takes time based on the size of the file or directory. You’ll see a message like this when the files are compressed successfully:
The compressed file thus created is password protected. If you try to extract it, it will ask you to enter the password:
As you can see, no one (in normal ways) can extract this file without the password. Congratulations, you just learned how to encrypt zip files in Ubuntu Linux.
Just for your information, double clicking on the password protected directory might give the impression that you may access the encrypted directory without a password, but you cannot actually read those files.
I hope this quick tutorial helped you to create password protected zip files in Linux. In coming days, we shall see how to password protect a directory in Linux and how to break the encryption. Stay tuned 🙂
Like what you read? Please share it with others.
Источник
How to Create a Password Protected ZIP File in Linux
ZIP is a very popular compression and file packaging utility for Unix-like operating systems as well as Windows. While perusing through the zip man page, I discovered some useful options for protecting zip archives.
In this post, I will show you how to create a password protected zip file on the terminal in Linux. This will help you learn a practical way of encrypting and decrypting contents of zip archive files.
First install zip utility in your Linux distribution using the package manger as shown.
How to Create Password Protected ZIP in Linux
Once installed, you can use the zip command with -p flag to create a password protected zip archive called ccat-command.zip from the directory of files called ccat-1.1.0 as follows.
Create Password Protected Zip File
However, the above method is absolutely insecure, because here the password is provided as clear-text on the command line. Secondly, it will also be stored in the history file (e.g
.bash_history for bash), meaning another user with access to your account (more especially root user) will easily see the password.
Therefore, try to always use the -e flag, it shows a prompt allowing you to enter a hidden password as shown.
Create Password Protect Zip Archive
How to Unzip Password Protected ZIP in Linux
To unzip and decrypt the content of the archive file called ccat-command.zip, use the unzip program and provide the password you entered above.
Decrypt ZIP Archive
That’s It! In this post, I described how to create a password protected zip file on the terminal in Linux. If you have any queries, or other useful related tip/tricks to share, use the comment form below ping us.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник
How to Create a Password Protected ZIP File in Linux?
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.
For Arch Linux:
For Red Hat, Fedora, and CentOS.
Usage
Zip the file with the following commands.
While running this command it will ask the password for a zip file.
Example:
Check your file(output_data.zip) is created with password protected.
Unzip
You can easily unzip the file with these commands.
While running this command it will ask the password for a decompressing zip file.
Example:
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.
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.
Источник