SEARCH

How-To Geek

How to Quickly Encrypt Removable Storage Devices with Ubuntu

image

Ubuntu can quickly encrypt USB flash drives and external hard drives. You’ll be prompted for your passphrase each time you connect the drive to your computer – your private data will be secure, even if you misplace the drive.

Ubuntu’s Disk Utility uses LUKS (Linux Unified Key Setup) encryption, which may not be compatible with other operating systems. However, the drive will be plug-and-play with any Linux system running the GNOME desktop.

Getting Started

You’ll have to install the cryptsetup package before you can use the Disk Utility’s encryption feature. Do so with the following command:

sudo apt-get install cryptsetup

image

You should also back up any files on the removable storage device before encrypting it. The encryption process will format the drive, deleting all data on it.

Encrypting a Drive

To encrypt a drive, launch the Disk Utility from the Dash. This utility is installed by default – if you don’t have it installed for some reason, install the gnome-disk-utility package.

image

Connect the removable storage device – for example, a USB flash drive or external hard drive – and select it from the Peripheral Devices section. Ensure you select the correct device so you don’t accidentally wipe important files.

image

After selecting the drive, click the Unmount Volume button in the right pane — you can’t format the device’s partition while it’s mounted. A removable storage device normally has a single partition on it, but you can create additional partitions here – for example, you could have one unencrypted partition and one encrypted partition on a USB stick.

image

Click the Format Volume button and enable the Encrypt underlying device check box.

image

The confirmation dialog doesn’t say so, but the formatting process will erase all files on the drive. Ensure you’re formatting the correct drive and you’ve backed up its files before continuing.

image

You’ll be prompted to create a passphrase – ensure you use a strong one. You can have Ubuntu remember the passphrase forever, if you like – this decreases security, but allows the drive to work on your current system without any prompts. If you take the drive to another system, you’ll be prompted to enter the appropriate password before using it.

image

Using an Encrypted Drive

Connect the removable storage device to any Ubuntu system – or any system running the GNOME desktop – and you’ll be prompted to enter your password. After you enter the password, the device will be usable.

image

A padlock icon identifies encrypted drives in the file manager.

image

If you ever want to change your passphrase in the future, you can use the Change Passphrase option in the Disk Utility. You can also format the volume again to remove the encryption.

image

Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.

  • Published 06/7/12

Comments (7)

  1. vonvon

    can use with windows ?

  2. aman

    if i connect this encrypted drive in windows…will it ask for password..

  3. Murphy

    This method will works under Linux only. If you want to use usb stick in windows/linux, then Truecrypt should do the trick.

  4. cam2644

    Thanks. I tried this out and it works perfectly.

  5. unueco

    > If you want to use usb stick in windows/linux, then Truecrypt should do the trick.
    I’m not sure that is true.

    I have a dual-boot system with a version of truecrypt on both sides.

    But drives that I created on the linux side still cannot be mounted using the windows version and visa-versa. Not sure why but I assume it has something to do with incompatible hash algorithms.

  6. vonvon

    yes Truecrypt can work on linux/windows

  7. Frank

    You can use FreeOTFE in Windows to access the encrypted volume.

    “Support for encrypted Linux volumes (Cryptoloop “losetup”, dm-crypt and LUKS)”
    http://www.freeotfe.org/

    Regards,
    Frank

Enter Your Email Here to Get Access for Free:

Go check your email!