It may be a good idea sometimes to keep certain files and folders in an encrypted location to prevent unauthorised access. This is especially important on a shared computer where you might have some sensitive documents that you don’t want other users to see.
A common technique used by some people is to hide the files in obscure locations, such as a deeply nested folder, where other users cannot easily find it, but that’s not entirely foolproof, as it could show up in search results.
Short of removing the file from the computer completely, the next best way to prevent unauthorised access to your private files is to store them in an encrypted location.
There are several ways to encrypt a folder in Ubuntu, but I will show you how to use VeraCrypt, a free, open-source and cross-platform data encryption tool.
To install VeraCrypt in Ubuntu, run the following commands in the terminal:
Once installed, launch it from the Unity Dash or your preferred application launcher.
Create an Encrypted Volume
The first thing you need to do is create an encrypted volume where you will store all folders you’d like to protect.
1. Select a drive slot, and click “Create Volume.”
2. Select “Create an encrypted file container” and click “Next.”
3. Choose “Standard VeraCrypt volume.”
4. Next, you need to create a file for your encrypted volume. Click “Select File.”
5. Navigate to the directory where you want the volume to reside, enter a name for the encrypted volume and click “Save.”
6. In the next step choose your preferred Encryption Algorithm and Hash Algorithm. The defaults should be okay for most uses.
7. Next, you need to specify the size of your encrypted container. Specify a big enough size to hold all the files you’d like to store there.
8. Now choose a complex password for your container. This is the password that will be used to mount the container and access any files stored there.
9. Next, select a filesystem for your container. FAT is the safest option because it works on all operating systems.
10. Move your mouse randomly on the window, preferably until the bar is full. This helps to increase the cryptographic strength of the encryption keys.
11. Finally, click “Format” to start the volume creation process. After a while you will get a success message. You can then exit the volume creation wizard.
Mount Encrypted Volume
To mount the encrypted volume, open VeraCrypt and select the file you created in the previous step.
Click “Mount” and enter the password you used while creating the volume.
Your container will be mounted and ready to use. Double click its drive slot to open it in your file manager.
You can use your encrypted volume just like any other partition on your hard drive. Anything you keep here will be encrypted and inaccessible to other users once you dismount the partition.
Please note that an encrypted volume is just like a file and can be deleted. You are advised to make regular backups on an external drive so that you don’t lose all your files if the volume gets deleted.
We’d love to hear how you protect sensitive documents on your Linux PC. Any thoughts, questions or suggestions are welcome.