2

I setup dm-crypt for a non-root partition on an Arch Linux installation and referenced a keyfile in /etc/crypttab (permissions -rw-------). However, during startup, I still get prompted for the password.

It does however recognize the name of the volume, which is only mentioned in the crypttab file, so it does use the file.

Steven Roose
  • 319
  • 1
  • 2
  • 10
  • 1
    What does the crypttab look like? Does the keyfile actually work when you use it on the command line? If so, which command are you using exactly? Which distro, which flavour of initramfs, could it already be unlocked by the initramfs, `cat /proc/cmdline`, ...? – frostschutz Oct 17 '16 at 16:50
  • @frostschutz I did not test using command line, no idea how. The crypttab is a simple `crypthome UUID=xxxx-xxxxx-xxxxx /etc/keyfilex luks`. – Steven Roose Oct 17 '16 at 17:07

1 Answers1

4

Solved.

Make sure you don't create the keyfile with nano or a regular echo, as this adds a trailing newline to the file. Do it like this:

echo -n "so_password_such_strong" > /etc/yourkeyfile

Steven Roose
  • 319
  • 1
  • 2
  • 10
  • The POSIX standard says that every line in a text file must be terminated with a line-break, including the last one. This is why `echo` and any POSIX compliant editor will always add one. A key file on the other hand is generally not considered a text file. It may contain any arbitrary byte sequence. – Bachsau Sep 26 '22 at 00:27