You are not logged in.

#1 2012-09-20 17:22:41

snufkin
Member
From: Sweden
Registered: 2008-11-08
Posts: 71

[SOLVED] Can't get encrypted /home to mount automatically

My /etc/crypttab looks like this:

home   /dev/sda2   /etc/myPwdIsHere

And I've created the password file using echo myPwd > /etc/myPwdIsHere.

Now, when I try to boot I first enter the password for my / partition, then when systemd tries to decrypt /home it says:

Failed to start Cryptography Setup for home.
[...]
systemctl status systemd-cryptsetup@home.service:
Set cipher [bla bla ...]  Invalid passphrase.

I know for a fact that the password isn't wrong. So, what to do?

Edit:
So, here's what I did.
1. Create a keyfile
2. Add the keyfile to the partition using luksAddKey
3. Update /etc/crypttab to point to the keyfile

Last edited by snufkin (2012-09-23 12:28:09)

Offline

#2 2012-09-20 20:24:35

Graveer
Member
From: Poland
Registered: 2011-07-24
Posts: 10

Re: [SOLVED] Can't get encrypted /home to mount automatically

What if, instead of the path to password, you just type your password. Like so:

home   /dev/sda2   theActualPassword

ThinkPad :: ArchLinux :: AwesomeWM

Offline

#3 2012-09-20 20:43:55

vik_k
Member
From: Pune, India
Registered: 2009-07-12
Posts: 227
Website

Re: [SOLVED] Can't get encrypted /home to mount automatically

path to a file signifies location of encrypted password, AFAIK. so either type the password in crypttab file or set the field to none (it'll ask for password during boot).


"First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack." ~ George Carrette

Offline

#4 2012-09-21 08:47:51

snufkin
Member
From: Sweden
Registered: 2008-11-08
Posts: 71

Re: [SOLVED] Can't get encrypted /home to mount automatically

Graveer wrote:

What if, instead of the path to password, you just type your password. Like so:

home   /dev/sda2   theActualPassword

It ignores is and asks for the same password to be entered at boot.

vik_k wrote:

path to a file signifies location of encrypted password, AFAIK. so either type the password in crypttab file or set the field to none (it'll ask for password during boot).

Oh, it does? How do you encrypt it in the correct format then? Password in the crypttab doesn't play nice with systemd, and entering it on boot is what I'm trying to avoid.

Offline

#5 2012-09-23 11:09:55

snufkin
Member
From: Sweden
Registered: 2008-11-08
Posts: 71

Re: [SOLVED] Can't get encrypted /home to mount automatically

I've figured out that I have to point to a file (with absolute path) in /etc/crypttab, but when I do cryptsetup says the password is wrong.

Here's the full (relevant) journalctl log:
systemd-cryptsetup[293]: Invalid passphrase.
systemd-cryptsetup[293]: Set cipher aes, mode xts-plain, key size 512 bits for device /dev/sda3.
systemd-cryptsetup[293]: Invalid passphrase.
systemd-cryptsetup[293]: Too many attempts.

Do I have to store the password in a certain format? Plaintext is apparently not working.

Offline

#6 2012-09-23 12:23:47

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: [SOLVED] Can't get encrypted /home to mount automatically

writing the password directly into /etc/crypttab is not supported anymore.
maybe the problem is that when you do "echo myPwd > /etc/myPwdIsHere" you have a newline (\n) at the end of the file which systemd-cryptsetup could consider part of the password. Try "echo -n password > file".

if this doesn't either, create a keyfile from /dev/random and add it the luks device. this definitively should work.

Last edited by 65kid (2012-09-23 12:24:19)

Offline

Board footer

Powered by FluxBB