【问题标题】:dropbear-initramfs can't find modprobe and blkiddropbear-initramfs 找不到 modprobe 和 blkid
【发布时间】:2020-01-26 23:05:17
【问题描述】:

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

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

步骤: 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"  

我的 /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"  

我的 /etc/crypttab

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

【问题讨论】:

    标签: encryption debian dropbear initramfs


    【解决方案1】:

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

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

    这在很长一段时间内都可以正常工作,但经过一些更新后它就停止了工作。我可以通过 SSH 连接到 initramfs 磁盘 dropbear 会话,但是当我执行“cryptroot-unlock”时它会挂起,并且我会收到错误消息“错误:在等待 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 分区。

    如果您收到错误“错误:等待 askpass 时已超时”。当在启动时 ssh'ed 到您的 dropbear-initramfs 时,尝试 cryptroot-unlock 驱动器。要确认问题是否与我的相同,请执行“ps”并查看正在运行的进程。如果看到类似于“/lib/cryptsetup/askpass.cryptsetup 请解锁磁盘..”的内容,我建议通过控制台登录并删除“cryptsetup-nuke-password”,以解决问题。

    【讨论】:

    • 我会马上试一试,但如果你想在你的驱动器上安装 nuk 键,它可能没用。希望开发人员尽快解决问题
    猜你喜欢
    • 1970-01-01
    • 2015-01-21
    • 2017-02-16
    • 2022-10-20
    • 1970-01-01
    • 2016-12-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多