3

This is in reference to: Ubuntu will not boot into busybox for remote LUKS decryption using dropbear

I have really like this solution by BinaryShrub.

One question: what is the right way to set the listening port of dropbear in this setup?

Thank you!

2 Answers 2

5

You can specify the options to dropbear in your /etc/initramfs-tools/initramfs.conf or /etc/dropbear/initramfs/dropbear.conf since Debian 12

DROPBEAR_OPTIONS="-p 2222"

And then rebuild the initramfs: update-initramfs -u

2
  • 1
    Note: /etc/dropbear-initramfs/config seems to be the place to do the dropbear specific configs now.
    – rel
    Jul 4, 2021 at 10:24
  • As I said on wiki.debian.org/DropBear the new folder is /etc/dropbear/initramfs Apr 1 at 15:18
4

I've managed to find a solution (nothing helped me on internet...), I've tried many things as change port in /etc/default/dropbear or etc/init.d/dropbear without any effect...

So, after searching how initramfs works and how dropbear is launched at boot, here is the solution:

$ cd /usr/share/initramfs-tools/scripts/init-premount
$ nano dropbear

then go to the function run_dropbear(), you should find a line with something like this:

exec /sbin/dropbear ${DROPBEAR_OPTIONS:-$PKGOPTION_dropbear_OPTION} -Fs

Just add the following option at the end of line:

exec /sbin/dropbear ${DROPBEAR_OPTIONS:-$PKGOPTION_dropbear_OPTION} -Fs -p #### (where #### is your port number)

Don't forget to run update-initramfs -u after this modification. Reboot. Your SSH at boot time should now be on the chosen port.

Cheers

2
  • That is much better then your first "answer". 10 points extra!
    – Fabby
    Oct 21, 2016 at 22:40
  • Used in this howto, thanks.
    – ceremcem
    Sep 21, 2018 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.