Fixing dropbear-initramfs '/scripts/init-premount/dropbear: cat: not found' error
Here’s an irritating one.
I use dropbear to remotely unlock LUKS-encrypted volumes. It works well. I can reboot a machine, and then use dropbear’s ssh to login, unlock the LUKS volumes, and then finish booting the machine.
Yesterday, I rebooted a machine, and I was unable to log in to dropbear’s ssh server. This was odd, and I had no reason to suspect anything was amiss.
Connecting a monitor to the machine and watching the boot process, I could unlock LUKS via a keyboard, but there was no sign that dropbear was loading, or that the initramfs had obtained an IP address (as would normally show).
After entering the password, the prompt did not show for around 60 seconds, and then showed a non-stop stream of error messages:
/scripts/init-premount/dropbear: cat not found
/scripts/init-premount/dropbear: sleep: not found
To stop this, I used Alt + F4
.
This brought me to the normal login prompt, so I could log in to the server.
The script in question is in /usr/share/initramfs-tools/scripts/init-premount
, but it looked fine. I compared it, and its permissions, with the script on a machine where dropbear-initramfs was working correctly, and they were identical.
I checked if cat
and sleep
are in the initramfs, using lsinitramfs /initrd.img | grep -e/{sleep,cat}
This returned:
usr/lib/modules/6.1.0-17-amd64/kernel/drivers/net/usb/catc.ko
usr/bin/sleep
usr/bin/cat
So it looked like both cat
and sleep
were present.
In the end, I did fix it, in that I removed dropbear-initramfs (apt remove --purge dropbear-initramfs -y
) and then reinstalled it (apt install dropbear-initramfs -y
), and re-added my settings to the config file.
I rebuild the initramfs and updated grub.
And it worked.
Why it worked, or why it needed this, or why it happened in the first place, I don’t know.
But perhaps even this will helpful someone - or me - in the future.
You may also like:
- Keeping bash history in sync using atuin and a self-hosted sync server
- Keyboard shortcut for adding random albums to the playlist in ncmpcpp
- This is a test post
- Fixing Mastodon 'Error processing thumbnail for uploaded media' video uploading
- Upgrading the glitch-soc fork of Mastodon
- Very, very initial thoughts of the Xreal Air 2 Pro glasses and Debian 12
- Using Bitwarden as an AppImage on Debian with GNOME
- A web UI for label creation and printing on a Brother QL-710W on Linux
- Getting a Brother QL-710W label printer working via CUPS on Debian
- Desktop Linux: the software I'm currently using
- Fixing apt yarn key deprecation warning in Debian 12
- Mounting LUKS-encrypted disks by UUID
- Making my ThinkPad LED flash 'decoded.legal' in morse code
- Unlocking a LUKS-encrypted partition via ssh on Debian 12 Bookworm
- Updating the LUKS key derivation function on Debian