Encrypt a USB drive on Linux

USB thumbdrives often store confidential information. However, it is very easy to loose. Encrypt a USB drive helps protecting your data with a password.

Here is how to encrypt a USB drive with cryptsetup:

First, install the cryptsetup package:

Then, ensure the USB drive is not mounted (replace /dev/sdb1 with the USB drive partition):

Now, let’s create an encrypted filesystem on the partition (choose a strong password):

Then, mount the filesystem and format it as FAT:

Then, unmount the device:

Next time the USB drive is inserted, a password will be prompted.

Leave a Reply

Your email address will not be published. Required fields are marked *