Dropbear cli configuration

I am having trouble configuring dropbear from the command line.

Some commands work as expected: eg
#dropbear -V
Returns the dropbear version number.

But others appear ineffective: eg
#dropbear -w
This should disallow root login, but it doesn’t.

I’ve tried this with/without a dropbear restart, and with/without a system reboot.

By contrast, if I use the config file (/etc/default/dropbear), followed by a dropbear restart or system reboot, everything works as expected.

What am I doing wrong?

Thanks.

Dropbear v2022.83
DietPi v9.15.2
RaspberryPi 4

I think that’s a misunderstanding. The CLI commands are not intended to configure a running instance. Instead, you can use dropbear -w to start a new instance in addition. Normally, this doesn’t work because port 22 is already occupied by the active SSH server.

Take a look at your log after you’ve executed dropbear -w. You should find the following there:

Aug 10 10:24:09 DietPiZ2 dropbear[6989]: Failed listening on '22': Error listening: Address already in use
Aug 10 10:24:09 DietPiZ2 dropbear[6989]: Early exit: No listening ports available.

For a permanent change, the configuration file must be used.

Thanks for your prompt reply.

I’ll stick to the config file (/etc/default/dropbear), as advised.