2

I need to have LUKS encryption on this system but during lab development I don't want to have to enter the password at the console each reboot. I'd like a way to set a simple password that can be passed and then later removed once the system is deployed.

http://atterer.org/linux-remove-disable-luks-encryption-password-on-disk-partition-crypttab-initrd

I found the above method but it's for debian and the paths don't exist. I tried to put a script with echo -n password that was executable as /boot/passphrase then updated /etc/crypttab to have keyscript=/boot/passphrase and it's not working.

Has anyone found a working method in fedora/RHEL6?

1

Should just be able to list the password in the /etc/crypttab file and it'll automatically use that when it loads.

example :

crypt_home /dev/sda2 yourpasswordhere
  • Yes per the manpage it appears you can use a password or an absolute path to a file containing the password.. – Andrew Siplas Feb 3 '19 at 23:33
1

Consider the different security issues with having your password in a file /etc/crypttab. That being said you can create an entry with the password itself or you can create a file and use that as a password as well

Anytime you want to add a new password you can use

cryptsetup luksAddKey /dev/sda2

And then type in a password which can then be used to unlock

If you want to use a file, you can create a file of any contents, e.g.

dd if=/dev/urandom of=/root/keyfile bs=1024 count=4

Then add that as a password

cryptsetup luksAddKey /dev/sda2 /root/keyfile

And your corresponding entry in /etc/crypttab would be

crypt_home /dev/sda2 /root/keyfile

Wrote this up in more detail here if you need it:

http://geekswing.com/geek/how-to-encrypt-a-filesystem-on-redhat-6-4centos-6-4-linux-fips-or-no-fips/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.