Checking Local Root Account Status
- Run
sudo passwd -S root: Look for the status letter in the output. An L means the account is locked (disabled), while a P means it has a usable password.
Checking Remote SSH Root Login Status
- Test the effective SSH setting: Run
sudo sshd -T | grep permitrootlogin. If it outputspermitrootlogin noorprohibit-password, remote root access via password is disabled. - Inspect the configuration files: Check
/etc/ssh/sshd_configand files inside/etc/ssh/sshd_config.d/forPermitRootLogin no