Dropbear-Initramfs 找不到 Modprobe 和 BLKID



我正在尝试让 dropbear 远程 ssh 启动在用 lvm 加密 luks 加密的 debian 系统上。

我可以在我的树莓派上让它工作,但不能在我的常规系统上工作

步骤: 1 使用 LVM 加密安装 Debian

ls -l /lib/modules/ |awk -F" " '{print $9}'
mkinitramfs -o /boot/initramfs.gz
echo initramfs initramfs.gz >> /boot/config.txt

然后创建一个前面有以下行的 RSA SSH 密钥,并将其保存到/etc/dropbear-initramfs/authorized_keyscommand="/scripts/local-top/cryptroot && kill -9 `ps | grep -m 1 'cryptroot' | cut -d ' ' -f 3`" ssh...

然后:

mkinitramfs -o /boot/initramfs.gz 
reboot

我可以输入密码并使用键盘解密,但是当我使用ssh登录时,我得到:

/scripts/local-top/cryptroot: line 218: modprobe: not found
/scripts/local-top/cryptroot: line 378: blkid: not found
/scripts/local-top/cryptroot: line 378: blkid: not found
/scripts/local-top/cryptroot: line 378: blkid: not found
/scripts/local-top/cryptroot: line 378: blkid: not found
/scripts/local-top/cryptroot: line 378: blkid: not found
...

请帮忙?

额外信息:
我的小子

/dev/sda1: UUID="42a9ca50-b757-4e11-985f-8fc75323b598" TYPE="ext2" PARTUUID="38de37f0-01"
/dev/sda5: UUID="3448b157-a1f9-4f6a-a1ea-37e6362cdea8" TYPE="crypto_LUKS" PARTUUID="38de37f0-05"       
/dev/mapper/sda5_crypt: UUID="nzAaP7-Ocx9-BJzO-BM7S-SQcY-BHqp-tbgvH6" TYPE="LVM2_member"
/dev/mapper/deb--vg-root: UUID="f8ec5b07-75fe-4870-9fb6-9e9035d21a20" TYPE="ext4"               
/dev/mapper/deb--vg-swap_1: UUID="ff915ae6-210f-4bbb-8988-b30aacae3dea" TYPE="swap"  

My/etc/fstab

/dev/sda1: UUID="42a9ca50-b757-4e11-985f-8fc75323b598" TYPE="ext2" PARTUUID="38de37f0-01"
/dev/sda5: UUID="3448b157-v4a5-4f6a-a1ea-28e6362cdea9" TYPE="crypto_LUKS" PARTUUID="38de37f0-05"
/dev/sdb1: UUID="CC55-BAFE" TYPE="vfat" PARTUUID="0000370e-01"                                          /dev/mapper/sda5_crypt: UUID="nzAaP7-Ocx9-BJzO-BM7S-SQcY-BHqp-tbgvH6" TYPE="LVM2_member"
/dev/mapper/theproject1--vg-root: UUID="f8ec5b07-75fe-4870-9fb6-9e9035d21a20" TYPE="ext4"
/dev/mapper/theproject1--vg-swap_1: UUID="ff915ae6-210f-4bbb-8988-b30aacae3dea" TYPE="swap"  

My/etc/crypttab

sda5_crypt UUID=3448b157-v4a5-4f6a-a1ea-28e6362cdea9 none luks,discard

我遇到了类似的问题,但解决方案不同。

我有一台加密的Kali Linux计算机,并使用dropbear-initramfs软件包使用cryptroot-unlock通过dropbear ssh会话远程解锁根磁盘。

这在很长一段时间内都工作正常,但是经过一些更新后它停止了工作。 我可以通过SSH连接到initramfs磁盘dropbear会话,但是当我执行"cryptroot解锁"时,它会挂起,并且会收到错误"错误:等待askpass时达到超时"。

最终我找到了解决方案:- https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1687842.html 基本上要修复我卸载了"cryptsetup-nuke-password"软件包"apt remove cryptsetup-nuke-password"。 然后重新启动,然后我可以通过 dropbear-initramfs 成功远程打开加密的/root 分区。

如果您在启动时对 dropbear-initramfs 进行 SSH 处理时收到错误"错误:等待 askpass 时达到超时",则尝试加密根解锁驱动器。 要确认问题是否与我的问题相同,请执行"ps"并查看正在运行的进程。如果看到类似于"/lib/cryptsetup/askpass.cryptsetup 请解锁磁盘......"的内容,那么我建议通过控制台登录并删除"cryptsetup-nuke-password",以解决问题。

最新更新