Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-15-2017, 10:21 AM   #1
Registered: Nov 2015
Posts: 397

Rep: Reputation: Disabled
crypttab - Unable to setup keyfile

From man crypttab:
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:

Here is how I setup the key file:
[root@Centos7-1024ram-minimal ~]# cat /etc/crypttab
secret  /dev/mapper/vg1-lv1     /root/luks-passphrase   luks
[root@Centos7-1024ram-minimal ~]# cat /root/luks-passphrase 
[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?
Old 03-15-2017, 10:36 AM   #2
Registered: Nov 2015
Posts: 397

Original Poster
Rep: Reputation: Disabled
Solved with this:
# cryptsetup luksAddKey /dev/mapper/vg1-lv1 /root/luks-passphrase
Enter any existing passphrase:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which process/program processes /etc/crypttab taylorkh Linux - Software 2 01-22-2017 08:38 PM
Conditional /etc/crypttab and /etc/fstab taylorkh Linux - Security 2 09-16-2016 01:37 PM
[SOLVED] crypttab not working tripialos Linux - Newbie 2 08-11-2013 03:44 AM
crypttab with nfs mounted keyfile guna_pmk Linux - Security 2 04-15-2011 06:14 AM
Unable to setup a NIS server setup on CentOS system swatidas11 Linux - Server 3 01-19-2010 07:01 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration