Encrypt a USB memory in Linux very easily

USB pendrive Windows 10

When you have a USB stick that you want to secure to avoid prying eyes, you probably need encrypt your data so that no one without the password can access them. For example, when one of these devices is shared or is within the reach of several people who should not have access, it is the best solution to protect it.

Do it on Linux It is very simple, you have several options for it. For example, in this tutorial I will use a valid method for the Debian / Ubuntu distro and derivatives, although it can also work in a similar way for others if you install the apps that I am going to detail here.

In order to encrypt your USB memory, you must first have the two programs to use. One of them is the graphical tool Disks, a utility that you will already have installed if you use the GNOME desktop environment by default. The other is cryptsetup, which is a tool for the CLI. If for some reason you don't have them, I recommend you execute these commands:

sudo apt-get install update -y

sudo apt-get install -y gnome-disk-utility cryptsetup

Now, you should already have them installed. The next thing is to determine the name of your USB memory to encrypt. To do this, connect your pendrive to the USB port and execute the command


That will list the available mediaAmong them, you should detect which is the partition or medium corresponding to your USB memory. It is important that you know the name well and do not get confused, or you could encrypt another drive that is not the correct one ...

It is important that the pendrive does not have anything inside, or if it does, that you make a backup copy, since the data will be erased in the process, since the unit will be formatted.

Now they would start steps for encryption unit:

  1. Opens Discs or Disk.
  2. Select the USB pendrive there between the units shown on the left.
  3. Disassemble the unit by clicking on the Stop box on the right, under the partition image.
  4. Now click on the gear icon to display the options. Choose Format partition ...
  5. It is time to select the options. Name your USB drive whatever you want. In the Type section choose «Internal disk for use with Linux systems only (ext4)«. Also mark «Password Protected Volume (LUKS)»To encrypt.
  6. press Next.
  7. In the next window it asks for the password to encrypt. Do not lose it, or you will not be able to access your data. Once you write it twice, click Next.
  8. Now it shows you a warning that data will be lost while formatting. Press Format.
  9. Wait for it to finish the process and you will have the unit ready.
  10. Now for the accesses it will ask you for your password, therefore, no one who does not have it will be able to access the data.

The content of the article adheres to our principles of editorial ethics. To report an error click here!.

Be the first to comment

Leave a Comment

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



  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.