Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to add dropbear to my initramfs so I can unlock the encrypted disk through a remote SSH session (as described here). I'm running Fedora 16 which apparently uses dracut to generate the initramfs image. Can anyone explain (or provide a link) how to add dropbear to initramfs using this setup?

Update:

I've been trying to learn more about dracut, but I'm finding that there's not a ton of information out there. Here is my current understanding, if anyone can comment on this:

  • I need to create a new dracut module which installs a pre-mount hook into the initramfs image.
  • The pre-mount hook will start the dropbear server, before any attempt is made to unlock/mount the LUKS filesystem (which presumably occurs during the "mount" phase).
  • With dropbear started, I should be able to SSH to the server and provide the passphrase to unlock it, as describe in the other post.
  • I also need to add a pre-pivot hook that will stop the dropbear server before the boot process chroots to the final root partition.
share|improve this question
    
If it's for the local network only, you could use telnet or netcat instead. I use netcat with a bit of random xor secret foo. Google finds several tutorials for dracut dropbear, did none of them work? –  frostschutz Mar 6 '13 at 23:58
    
No, actually I'm getting very few (relevant) results on Google. I've tried "dropbear dracut" and "dropbear dracut tutorial". There's a few hits that are actually relevant, but none of them have been useful, –  sh1ftst0rm Mar 7 '13 at 0:28
add comment

1 Answer

up vote 0 down vote accepted

I was able to cobble together my own dracut module that adds dropbear to the initramfs and starts it during init. It also replaces the cryptroot-ask script from the dracut-crypt module (which asks you for your LUKS password) with a custom one which sits around and waits for you to unlock the filesystem yourself (e.g., over SSH) (as well as a little extra hocus).

I've put it up on bitbucket if anyone wants to use or improve it. It currently doesn't shutdown the dropbear server after boot, so that's probably something that could be improved.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.