How do I protect ssh login for AlmaLinux 9 ? PermitRootLogin No in /etc/ssh/sshd_config file didn’t work
The default is now PermitRootLogin prohibit-password
.
If you did select in installer the “Allow root log with password”, then there is file
/etc/ssh/sshd_config.d/01-permitrootlogin.conf
with PermitRootLogin yes
in it. You can remove that file.
The /etc/ssh/sshd_config
does contain Include /etc/ssh/sshd_config.d/*.conf
early and “the first obtained value will be used”.
Therefore, you should add file into /etc/ssh/sshd_config.d/
.
Perhaps named 00-akpaninoroot.conf
and have in it:
PermitRootLogin no