Skip to content

Instantly share code, notes, and snippets.

@AndreaGhizzoni
Last active October 24, 2017 09:25
Show Gist options
  • Save AndreaGhizzoni/74fb462b81ce7e9fe021e21b1576147a to your computer and use it in GitHub Desktop.
Save AndreaGhizzoni/74fb462b81ce7e9fe021e21b1576147a to your computer and use it in GitHub Desktop.
luks-entrypted-flash-drive.md

LUKS Encrypted Drive

Main Source

Then other source

Dependencies

$ apt-get install cryptmount cryptsetup

Creating new Encrypted device

Insert the usb drive and check with lsblk the device path, here I assume that is /dev/sdd.

$ cryptsetup luksFormat /dev/sdd1

WARNING!
========
This will overwrite data on /dev/sdd1 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter LUKS passphrase:
Verify passphrase:
$ cryptsetup luksOpen /dev/sdd1 crypt
Enter passphrase for /dev/sdd1:
$ mkfs -t ext2 /dev/mapper/crypt
$ cryptsetup luksClose crypt

Mount

$ cryptsetup luksOpen /dev/sdd1 crypt
Enter passphrase for /dev/sdd1:
$ mkdir USB
$ mount -t auto /dev/mapper/crypt USB

Unmout

$ umount USB
$ cryptsetup luksClose crypt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment