![]() |
FULL disk encryption on Slackware - avoid having to type password twice
Hello there.
Recently I decided to hop on to Slackware after becoming bored with Arch which I've been running on various machines for years. At least for my laptop I always set it up using full disk encryption, which works flawlessly on Arch which uses mkinitcpio. FULL Encryption meaning that there isn't an unencrypted boot partition holding the initramfs, but a single encrypted root partition in the case of MBR - and aditionally an ESP for EFI. The system can normally load the Grub bootloader, prompting for a password, which then decrypts the drive and loads the initramfs, which can then mount the root filesystem **inside** the initramfs, loading a keyfile from the decrypted root filesystem and decrypt automatically, thus avoiding making me type the password twice. This works flawlessly on my other laptop running Arch. This is how I have set it up: Grub: Code:
# /etc/default/grubCode:
# /etc/mkinitcpio.confhttps://docs.slackware.com/slackbook:booting http://polarhome.com/service/man/?qf...Slackware&sf=5 But I don't want to rule out the possibility that I have made an error configuring the initrd file. This is how I've set it up: /etc/initrd.conf: Code:
LVM="0"Is installing mkinitcpio on Slackware a viable option? Any ideas? Best regards. EDIT - SOLUTION: https://www.linuxquestions.org/quest...ml#post6424882 |
Help. Pls
|
Hi,
with the same goal I had modified the script mkinitrd in Slint-14.2.1 using this patch. I have suggested to do something similar in Slackware, to no avail. In Slint64-15.0 I have switched to dracut that handle that without any modification, further dracut knows which kernel modules include in the initramfs in this case, lot less maintenance for me as Slint maintainer. If I remember well I have also suggested to do that in Slackware, still to no avail. I also have suggested to replace lilo and elilo by grub several times, still to no avail. In Slint users are proposed at time of installation to have the target drive fully encrypted and then will have type the passphrase only once (when requested by GRUB). You may request to have this implemented in Slackware. Good luck. PS. To be honest a solution is proposed for Slackware in README_CRYPT.TXT but I prefer not to add a level of complexity relying on LVM. |
Quote:
As far as I know, that initrd "tool" was made by the Slackware Team for Slackware. |
Quote:
I for one, honestly I will prefer the Arch way to handle the initrds over Dracut. ;) And probably this mkinitcpio package of Arch Linux can be adapted to Slackware. |
Quote:
There isn't a Dracut Slackbuild unfortunately. But it's easy enough to create our own packages on slack, as I've learned. Can Dracut also resume from an encrypted swap? Otherwise I'd prefer to use the tool that has worked for me before: Quote:
As for initrd being deprecated, I think it's functionality is deprecated, compared to the tools of other distibutions. But I guess that is something we have to live with on SLACKware. Other than that, from what I've seen I like Slackware a lot. |
"full disk" versus "just enough disk"?
Hi,
I followed the 'tumfatig' guide for FDE (apologies for not posting the link, but this is my first post and apparently one cannot post URLs in a first post => if you google 'tumfatig slackware fde' and use the article from 2023-01-31, you'll find it) But on to business: From what I can gather, you would consider this to be 'not full disk encryption' because the initrd and kernel reside on a non-encrypted partition. Can you tell me what avenues of attack I should consider that would put my data at risk when doing it this way? I believe it to be sufficient based on the fact that nothing 'personally identifiable' is unencrypted. Should the laptop be stolen, all they'd have is a generic kernel and an initrd that points to an encrypted partition, which is likely already identifiable with an entropy map even without looking at the initrd or kernel. Kind regards, sstm |
Quote:
Quote:
|
Thanks for providing the package! I'll definetely try that tomorrow.
No offense, but I think most people nowadays will opt for more established projects. There are already so many Slack based distros. Maybe you should try getting your changes implemented into PClinux OS or similar who are using Slackware as base if Volkerdingen doesn't want to implement it. |
Quote:
I also don't know if something similar could be done with UEFI? Couldn't you install malicious software in the ESP partition as well? Maybe I just do it for the hell of it. Linux is an obsession after all. A good obsession, I like to think. You learn to use computers responsibly. If I can't get it to work, I'll just go with the recommended layout of having a non encrypted boot. |
Not sure if this will help but here is an article that has a way. I also get annoyed having to type my password twice on my laptop but have gotten used to it. I may try this in a virtual machine.
https://yellowapple.us/2022/02/10/sl...#hack-initrdgz |
Quote:
You can use grub-mkimage to roll your own efi image - you can give it a grub.cfg file that does something similar or even does the cryptsetup stuff all immediately - I've read somewhere that this could entail a speed hit when loading because "not all resources are available to do this yet" - didn't verify this. I believe that if you enable secure boot, it'll verify the image against your own keys (if you configure it to do so), but I think that ultimately this doesn't add more security because secureboot can be turned off (or a bios can be reset). Maybe the security comes from the keys being wiped if you reset the bios to reset the bios password (this would let you change what the valid signing keys are)? In any case, even without having secure boot active, if you manage to install a keylogger on my device using efi image or by modifying my vmlinuz or initrd, I'd say you've earned the right to see what games I'm playing and what my bills look like :D Anything with real worth can be covered with 2FA-related measures and I think that at some point, before running into every possible hurdle I can throw in there in order for someone else to access my data, the more "analog" ways of pressure will be applied to get me to yield that disk password. It's a lot of complexity (which can be misconfigured, leading to even easier compromise) for something that they can ultimately get at anyways if given enough time and means :( If they really want your data and it's "this well guarded" (or if it seems that way), I'm sure that the more 'analog' ways of getting you to yield the disk encryption keys will be much more viable for any attacker. apologies for the wall of text :) |
No, you are right. If there's already forensic experts with that expertise at work, they might as well put us on drugs or torture us to get that password. And yeah, I even though I guess I'm pretty "edgy", I don't think I'm that interesting.
|
Quote:
BUT, in the end, it's also based in BusyBox & Co., then "someone interested" may succeed to adapt it to work properly in Slackware. So, considering your previous experience with Arch, how about to take this porting of mkinitcpio to Slackware as your pet project? :D In the end, from what I seen, Slackware is a county town where if you want meat at dinner, you should grab your dagger and go to forest, to hunt a bear or something. ;) Quote:
In other hand, seems like our BDFL believes that his initrds cover all user cases. That they are perfect. I for one, I talked since long time about the necessity to make the initrds more modular. However, seems like to deaf ears. So, feel free to argue (preferably showing patches or source code) about this subject, if you are interested on those things. In the end, I can't argue alone with this entire forum for every little thing which I believe it's an improvement. :p Quote:
|
Quote:
Q: Why according with the KGB specialists there is no password with a strength greater than 9 fingers? A: Because anyone needs at least one finger to take care of his own nose. |
| All times are GMT -5. The time now is 05:55 PM. |