LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   crypttab - Unable to setup keyfile (https://www.linuxquestions.org/questions/linux-newbie-8/crypttab-unable-to-setup-keyfile-4175601821/)

fanoflq 03-15-2017 10:21 AM

crypttab - Unable to setup keyfile
 
From man crypttab:
Quote:

The third field, key file, describes the file to use
as a key for decrypting the data of the source device.
Note that the entire key file will be used as the
passphrase; the passphrase must not be followed
by a newline character.

It can also be a device name (e.g. /dev/urandom), note
however that LUKS requires a persistent key and therefore
does not support random data keys.

If the key file is the string “none”, a passphrase will
be read interactively from the console. In this case,
the options precheck, check, checkargs and tries may be useful.

I saw this post:
http://www.linuxquestions.org/questi...ng-4175472894/

Here is how I setup the key file:
Code:

[root@Centos7-1024ram-minimal ~]# cat /etc/crypttab
secret  /dev/mapper/vg1-lv1    /root/luks-passphrase  luks
[root@Centos7-1024ram-minimal ~]# cat /root/luks-passphrase
A123456123456
[root@Centos7-1024ram-minimal ~]#

When I input the passphrase into the file /root/luks-passphrase,
I make sure not to hit the <Enter> at the end of the passphrase so
as to avoid a new line.

But it is not working on reboot.
It still ask for manual entry of passphrase.
What did I missed?

fanoflq 03-15-2017 10:36 AM

Solved with this:
Quote:

# cryptsetup luksAddKey /dev/mapper/vg1-lv1 /root/luks-passphrase
Enter any existing passphrase:


All times are GMT -5. The time now is 12:48 PM.