Linux Foo - Manage LUKS key
I assume this is a bit of a dated set of procedures... as-in, there is probably a better way to deal with LUKS nowadays. Also - at some point I will (hopefully) be writing a blog entry about LUKS key accessed from centralized key server. Assessment cryptsetup luksDump /dev/sda1 cryptsetup luksOpen --test-passphrase --key-slot 3 --key-file /root/.keyfile /dev/sda1 Setup # If there is already a crypttab, update it... otherwise, create a new one if [ -f /etc/crypttab ] then sed -i -e '1i# <target name> <source device> <key file> <options>' /etc/crypttab else echo "# <target name> <source device> <key file> <options> " > /etc/crypttab fi # Create a "key file" and add it to the device (interactive step) dd if=/dev/urandom of=/root/.keyfile bs=32 count=1 chmod 0400 /root/.ke...