Allow root SSH on Debian Bullseye

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

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.

Did you find this article useful? Why not share it with your friends?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.