我已经在Linux (Ubuntu22.04)机器上配置了DropBear SSH。我使用的配置如下:
$ cat /etc/dropbear-initramfs/config
#
# Configuration options for the dropbear-initramfs boot scripts.
# You must run update-initramfs(8) to effect changes to this file (like
# for other files under the '/etc/dropbear-initramfs' directory).
#
# Command line options to pass to dropbear(8)
#
# -I 0: disables idle timeouts for innactivity
# -s: disable passwords
DROPBEAR_OPTIONS="-p 2222 -I 0 -s"
#
# On local (non-NFS) mounts, interfaces matching this pattern are
# brought down before exiting the ramdisk to avoid dirty network
# configuration in the normal kernel.
# The special value 'none' keeps all interfaces up and preserves routing
# tables and addresses.
#
#IFDOWN=*我已经测试过它(手动)关闭了机器;服务器在启动后立即启动,我能够连接到它。但是,如果我从机器本身运行sudo reboot,服务器在重新启动后不会启动,并且无法连接到DropBear的SSH服务器(机器中的日志显示DropBear正在运行,但机器在2222年无法到达)。
唯一能够工作的顺序(每次都会出现几乎)是如果我重新启动机器时:
$ sudo -i
# echo 1 > /proc/sys/kernel/sysrq
# echo b > /proc/sysrq-trigger我不完全确定为什么,但我想,发送给重启机器的信号在上述两种方法之间是不同的。这会是问题吗?重启计算机并在重启后运行DropBear的最佳方法是什么?
发布于 2023-01-07 22:58:09
配置文件路径似乎已经发生了变化,至少最近我遇到了类似的问题。目录更改为
/etc/dropbear-initramfs/至
/etc/dropbear/initramfs/尝试将您的配置放入文件/etc/dropbear/initramfs/dropbear.conf中。
请注意,目录的更改也会影响例如authorized_keys文件。
https://unix.stackexchange.com/questions/730377
复制相似问题