In this tutorial, we will explain for newbies how to easily password protect files or folders in Ubuntu/Linux Mint systems. You don't have to use any third-party software, we will just use the archive manager to compress the file or folder and lock it with a password so that you disallow unauthorized users from copying your contents.

Getting Started

Right click on the file(s) or folder(s) and select Compress:

In the window that will appear, select a compression format (7z, zip, tar, etc.), then click Other Options:

Enter any password of your choice, check on "Encrypt the file list too", then click Create:

You have now compressed and password-protected your file/folder. No user can now extract the archive file unless he/she provides the correct password:

More Advanced Options

If you want to prevent other users from deleting or moving the password-protected archive file you have just created, open the terminal and cd to where it is stored, then run this command:

sudo  chattr +i file-name.ext
To undo this, enter this command:

sudo  chattr -i file-name.ext