Why use a drop-in file in /etc/ssh/sshd_config.d/ instead of editing sshd_config?
IntermediateProductionSSH & Access Hardening
Answer
Package upgrades may ship a new sshd_config and prompt or create .rpmnew/.dpkg-dist files; drop-ins are never touched. Configuration management also manages one small file cleanly. Note that sshd uses the first value it reads for most keywords, and the main file Includes the drop-ins near the top, so drop-ins win. On Ubuntu cloud images, 50-cloud-init.conf may set PasswordAuthentication yes, so name yours with a lower number.
More on SSH & Access Hardening
What are the first sshd_config changes you make on a new production server?BeginnerWhy disable SSH password authentication entirely?BeginnerShould you change the SSH port from 22?IntermediateWhat are SSH certificates and why do large fleets use them?AdvancedHow do you restrict what a specific SSH key can do?AdvancedHow do you apply different sshd rules for different users or networks?Intermediate