Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
genkernel initramfs post luks key over ssh
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
soratobuneko
n00b
n00b


Joined: 20 Oct 2020
Posts: 25

PostPosted: Tue Feb 23, 2021 6:33 pm    Post subject: genkernel initramfs post luks key over ssh Reply with quote

Hello,

I have a gentoo setup with luks encrypted root and I want to be able to unlock the partition by using
Code:
gpg --decrypt key.asc | ssh root@gentoo-initramfs post root

But for some reason this way isn't working. I get the error that I entered the wrong key. But if I scp the key file to the initramfs system and do
Code:
gpg --decrypt key.asc | cryptsetup luksOpen /dev/[encrypted_root] root --key-file -

I can successfully unlock the disk partition.

I'm using a binary keyfile of 8MB (max allowed size with luks, if I am not wrong).

I read on https://forums.gentoo.org/viewtopic-t-981716-start-0.html something about the initramfs unlocking process reading the key only until the first new line character encountered. Is it the reason I fail to unlock root partition piping a binary key through ssh to the "post" script? Or is there a size limit smaller than 8MB?

If this is the newline character which is causing the issue, how can I generate a compatible key of 8MB of random bits?
Back to top
View user's profile Send private message
Whissi
Retired Dev
Retired Dev


Joined: 12 Jan 2011
Posts: 222

PostPosted: Mon Mar 01, 2021 5:06 pm    Post subject: Reply with quote

If you are using a keyfile, i.e. require to pass --key-file argument to cryptsetup, you cannot use https://wiki.gentoo.org/wiki/Genkernel#Automatic_unlock -- this only works with passphrases.
_________________
Regards,
Whissi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum