我无法登录 ssh 来加密已安装 dropbear 的 luks 加密设备,但在 rpi 解密时可以。我收到错误:ssh:连接到主机树莓端口 22:没有到主机的路由。启动 pi 时出现错误: ipconfig: eth0: SIOCGIFINDEX: 启动时没有这样的设备。该设备是安装了 Raspbian 9 Stretch 操作系统的 Raspberry Pi。我正在遵循本指南https://stinkyparkia.wordpress.com/2014/10/14/remote-unlocking-luks-encrypted-lvm-using-dropbear-ssh-in-ubuntu-server-14-04-1-with-static-ipst/。我想配置远程解锁 crypt luks 加密的 rpi 设备。我已设置NO_START
为 0 并复制了 ssh 密钥。命令的结果ifconfig -a
:
$ sudo ifconfig -a
enxb827eb1b2a72: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::83:5d01:52b3:b571 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:1b:2a:72 txqueuelen 1000 (Ethernet)
RX packets 1141 bytes 115055 (112.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 843 bytes 132826 (129.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 102 bytes 7746 (7.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 102 bytes 7746 (7.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::1c84:9d97:1351:eec4 prefixlen 64 scopeid 0x20<link>
ether ec:08:6b:0b:fa:a1 txqueuelen 1000 (Ethernet)
RX packets 384 bytes 21449 (20.9 KiB)
RX errors 0 dropped 135 overruns 0 frame 0
TX packets 57 bytes 8368 (8.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
请注意,192.168.1.5 是我在 中设置的静态 IP 地址/etc/network/interfaces
。
我在 DEVICE= 行下添加了静态 IP /etc/initramfs-tools/initramfs.conf
:
IP=192.168.1.5::192.168.1.254:255.255.255.0::enxb827eb1b2a72:off
和文件底部/usr/share/initramfs-tools/scripts/init-bottom/dropbear
:
ifconfig enxb827eb1b2a72 0.0.0.0 down
但它没有任何作用。
命令的结果sudo ip route show
:
$ sudo ip route show
default via 192.168.1.254 dev enxb827eb1b2a72 src 192.168.1.5 metric 202
default via 192.168.1.254 dev wlan0 src 192.168.1.1 metric 203
192.168.1.0/24 dev enxb827eb1b2a72 proto kernel scope link src 192.168.1.5 metric 202
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.1 metric 203
答案1
我通过添加net.ifnames=0 biosdevname=0
到/boot/cmdline.txt 解决了这个问题。接口名称错误。