Skip to content

Instantly share code, notes, and snippets.

@spvkgn
Last active June 24, 2017 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spvkgn/a5412912ecb731af544a49b0f85acf2c to your computer and use it in GitHub Desktop.
Save spvkgn/a5412912ecb731af544a49b0f85acf2c to your computer and use it in GitHub Desktop.
Add random keyfile to existing LUKS device
sudo dd if=/dev/urandom of=/root/keyfile bs=1024 count=4
sudo chmod 0400 /root/keyfile
sudo cryptsetup luksAddKey /dev/sdX /root/keyfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment