Recently after installing a fresh new copy of Debian 11 (Bullseye), I found that root ssh access was set to without-password
by default now. What that means to you is that if you are trying to ssh to your server with your root account and password, you will receive an access denied error. In order to overcome this limitation, you will need to add a default sshd_config override file at /etc/ssh/sshd_config.d/10-enable-root.conf
to allow root password logins through ssh. As shown below, command creates 10-enable-root.conf
cat << EOF > /etc/ssh/sshd_config.d/10-enable-root.conf StrictModes yes LoginGraceTime 10 PermitRootLogin yes ClientAliveInterval 300 ClientAliveCountMax 0 EOF
Once the file is created, you will need to restart the ssh daemon in order for the changes to take affect using the command below.
systemctl restart sshd
After the ssh service is restarted, you should now be able to login through ssh using your root account and password.