OpenSSH Config changes being ignored

Not sure if this is a bug so decided not to follow the bug report template, if it is a bug I would be more then willing to edit this post.

I’m currently running the latest DietPi release on a Raspberry Pi 4 (8GB) unit.

Initially was using Dropbear SSH without any issues, however decided I needed to switch over to OpenSSH for a specific application.

I performed the switch via the default DietPi user over Dropbear SSH via the DietPi package manager tool (Can’t recall the specific name) Dropbear was purged successfully, and automatically replaced with OpenSSH.

At this point I attempted to modify the OpenSSH Server side Config “/etc/ssh/sshd_config” file via nano with sudo permissions.

I uncommented the line referring to “PremitRootLogin” and set the option to “PremitRootLogin no” and saved the file, following with a restart of the SSH daemon.

The changes were ignored, I even tried rebooting my DietPi Instance, no luck.

I need to harden my security and would like to follow best practices for SSH, any help troubleshooting this issue would be greatly appreciated, Thank you.

Basically this is working as designed because we use a drop-in configuration for DietPi to overwrite OpenSSH defaults.

You need to modify /etc/ssh/sshd_config.d/dietpi.conf or simply run following command to disable ssh password logins for user root

/boot/dietpi/func/dietpi-set_software disable_ssh_password_logins root
2 Likes