I faced a very weird issue today, sshd failed to start on boot because ListenAddress was set but network.target doesn't mean IP addresses are already assigned and ready. So the configured IP isn't available, therefore sshd can't bind a Port and failed with fatal: Cannot bind any address.
I thought this can be fixed by adjusting the sshd systemd unit, everything I found online also pointed into that direction, for example a Debian (Archive: , ) and Ubuntu (Archive: , ) Bug report.
/etc/systemd/system/ssh.service.d/override.conf [Unit] After=network-online.target auditd.service
The above systemd override seem to be one of the popular solutions which works for a lot of people. Unfortunately none of the various After/Wants combinations worked in my case on Debian 11.
Probably not the most elegant solution but it's working and due to the fact that multiple IP addresses are assigned to the Server, I have to specify on which the SSH Daemon is listening and can't just let em bind to all.