我的Raspberry Pi(现在距离我10,000公里)的工作原理如下:
/boot
cryptsetup
)包含/
dropbear
。它要求输入 HDD 的密码,然后启动顺序将正常继续。有关我如何完成这一切的更多信息,请阅读http://blog.romainpellerin.eu/raspberry-pi-the-ultimate-guide.html。
TL;DR这是一个简化版本:
apt-get install busybox cryptsetup rsync
echo "initramfs initramfs.gz 0x00f00000" >> /boot/config.txt
sed -e "s|root=/dev/mmcblk0p2|root=/dev/mapper/hddcrypt cryptdevice=/dev/sda1:hddcrypt|" -i /boot/cmdline.txt
sed -e "s|/dev/mmcblk0p2|/dev/mapper/hddcrypt|" -i /etc/fstab
echo -e "hddcrypt\t/dev/sda1\tnone\tluks" >> /etc/crypttab
cryptsetup --verify-passphrase -c aes-xts-plain64 -s 512 -h sha256 luksFormat /dev/sda1
mkinitramfs -o /boot/initramfs.gz $(uname -r)
aptitude install dropbear
// Configuring the SSH access …
Run Code Online (Sandbox Code Playgroud)