1

I have configured DropBear SSH in a Linux (Ubuntu 22.04) machine. The configuration I'm using is the following:

$ 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=*

And I have tested it powering down (manually) the machine; the server starts immediately after startup and I'm able to connect to it. However, if I run sudo reboot from the machine itself, the server does not start after rebooting and I can't connect to the SSH server of DropBear (logs in the machine show that DropBear is running but the machine is not reachable in 2222).

The only sequence that seems to work (almost every time) is if I restart the machine doing:

$ sudo -i
# echo 1 > /proc/sys/kernel/sysrq
# echo b > /proc/sysrq-trigger

I'm not entirely sure why but I guess the signals sent to reboot the machine are different between the two aforementioned methods. Can this be the issue? What's the best way to reboot a machine and have DropBear running after rebooting?

1 Answer 1

1

The config file path seems to have changed, at least I experienced similar issues due to to this recently. The directory changed from

/etc/dropbear-initramfs/

to

/etc/dropbear/initramfs/

Try to put your config into the file /etc/dropbear/initramfs/dropbear.conf instead.

Note that the directory change also affects e.g. the authorized_keys file.

1
  • While this is true, in the version I'm using the path is correctly configured because when the server works, works accordingly to the config provided, so that's not the reason why. Thanks anyway! Commented Jan 8, 2023 at 9:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .