Red HatJosephine PfeifferTutorial
Unlock a LUKS root over SSH on Fedora and Red Hat Enterprise Linux
Summary
Remote Fedora or Red Hat Enterprise Linux servers with encrypted LUKS roots can stop in the initramfs, waiting for a passphrase at an unattended console. The documented setup installs dracut-sshd from EPEL, adds dracut’s network-manager module, enables rd.neednet=1 and ip=dhcp in GRUB, then rebuilds the initramfs and boot configuration. NetworkManager brings up the initramfs network, while SSH exposes systemd-tty-ask-password-agent; the SSH session closes after unlocking because the root transition destroys the initramfs sshd. The rd.neednet=1 argument creates the neednet flag that gates nm-initrd.service, and the generated connection profile carries into the real root. Initramfs credentials sit unencrypted on /boot, so dedicated host keys, separate known_hosts entries, and physical testing are recommended before relying on remote recovery.
Context
A remote encrypted server can reboot into the initramfs and wait for a passphrase at a console where nobody is present to enter it.
Approach / What changed
Install dracut-sshd from EPEL, configure dracut’s network-manager module, add rd.neednet=1 and ip=dhcp to GRUB_CMDLINE_LINUX, and rebuild the initramfs and GRUB configuration. The resulting initramfs runs NetworkManager and sshd, allowing systemd-tty-ask-password-agent to unlock the LUKS root over SSH.
Takeaways
rd.neednet=1 is what makes dracut’s initramfs networking unit run; the /run/NetworkManager/initrd/neednet flag gates nm-initrd.service, and without it the unit is skipped rather than reported as failed.
dracut-sshd normally copies /root/.ssh/authorized_keys and host keys into the initramfs, but those credentials are unencrypted on /boot; dedicated dracut SSH host keys avoid reusing the running system’s identity.
The initramfs-generated NetworkManager keyfile remains in /run across switch-root, allowing NetworkManager on the real root to read the same connection profile and UUID.
Source and freshness
- Source
- developers.redhat.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.