Skip to content

Instantly share code, notes, and snippets.

@rasmusmerzin
Last active June 22, 2022 23:44
Show Gist options
  • Save rasmusmerzin/1f1c029fe591609a3ddbba825725cdcf to your computer and use it in GitHub Desktop.
Save rasmusmerzin/1f1c029fe591609a3ddbba825725cdcf to your computer and use it in GitHub Desktop.

Cryptsetup LUKS

Given:

  • partition /dev/sda1
  • mapping secrets
  • mountpoint /mnt

Init

cryptsetup -h sha256 -c aes-xts-plain -s 256 luksFormat /dev/sda1

Open

cryptsetup luksOpen /dev/sda1 secrets

Close

cryptsetup luksClose secrets

Using

mkfs.fat -F32 /dev/mapper/secrets
mount /dev/mapper/secrets /mnt
unmount /mnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment