Skip to content

Instantly share code, notes, and snippets.

@intrd
Last active January 23, 2025 19:31
Show Gist options
  • Save intrd/0223e771eefbc242bfccb9b687b374bd to your computer and use it in GitHub Desktop.
Save intrd/0223e771eefbc242bfccb9b687b374bd to your computer and use it in GitHub Desktop.
Remotely Boot and Unlock a Linux Full Disk Encrypted machine (LUKS) with Dropbear

Installing dropbear to initramfs

sudo apt update
sudo apt install dropbear-initramfs
sudo -i
cd /etc/dropbear/initramfs/
nano dropbear.conf
DROPBEAR_OPTIONS="-I 239 -j -k -p 8008 -s"
nano /etc/initramfs-tools/initramfs.conf
IP=192.168.1.11::192.168.1.1:255.255.255.0:YOURHOSTNAME
sudo update-initramfs -u -v
ssh-keygen -t rsa -f ~/.ssh/dropbear
cat ~/.ssh/dropbear.pub
nano /etc/dropbear/initramfs/authorized_keys
sudo update-initramfs -u
reboot

Connect and unlock

ssh -i ~/.ssh/dropbear -p 8008
cryptroot-unlock # to unlock and boot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment