How to secure our zip file with password on Linux, by GoliTech on YouTube. 1 min 43 s.
- Video length
- 1 min 43 s
- Time to do it
- 5 minutes
- Difficulty
- Easy
- Steps
- 7
What you need
Steps
Open a terminal and use cd to move into the folder that holds the files you want to protect, for example cd ~/Documents/reports.
Check the tool is there by running zip --version. On Ubuntu or Debian install it with sudo apt install zip, on Fedora with sudo dnf install zip.
Create the archive with the -e flag, listing the files to add: zip -e secret.zip notes.txt budget.txt. The -e flag is what makes zip ask for a password.
Type your password at the Enter password prompt and press Enter, then type it again at Verify password. Nothing shows on screen while you type.
To protect a whole folder, add the -r flag so zip walks into it: zip -e -r project.zip project/.
List the contents with unzip -l secret.zip, then test the password by extracting to a scratch folder such as unzip secret.zip -d /tmp/test.
Once the archive opens with your password, delete the original unencrypted files with rm, or move them somewhere safe.
Tips and common mistakes
Do not use -P yourpassword on the command line, because the password stays in your shell history; use -e so zip prompts you instead.
Standard zip encryption is weak, so for really sensitive data use 7z a -p -mhe=secret archive.7z files for AES-256.
Pick a long passphrase you can retype, since a lost ZIP password is very hard to recover.
Standard password-protected ZIPs open in Windows Explorer and macOS Archive Utility, but AES archives need 7-Zip or a similar tool.
Questions
How do I password protect a folder instead of single files?
Add the -r flag so zip includes everything inside the folder, for example zip -e -r project.zip project/. Without -r only an empty folder entry is stored.
How do I remove the password later?
Unzip the archive with your password, then create a new archive without the -e flag. You cannot strip encryption from an existing ZIP in place.
Will the person receiving the file need Linux?
No. A standard password-protected ZIP opens on Windows and macOS too, as long as they have the password.
This guide was drafted from the video's details and general task knowledge. It has not been checked against the full video. Check the video and relevant product instructions before following a procedure. Report a correction.



