Securing SSH - Bao108/SYS-255 GitHub Wiki

SSH file

sudo nano /etc/ssh/sshd_config

Disabling root SSH access

Uncomment what you want to change, and always make a backup file

Check Root override file

remove the override file (01-permitrootlogin.conf)

sudo rm -f /etc/ssh/sshd_config.d/01-permitrootlogin.conf
sudo systemctl restart sshd

note. Restarting the sshd service will apply the changes made


Verify

If you get access denied with the correct passwd then the root will not be able to SSH (this can also be done through PowerShell)
To view specifically SSH logs, use 'journalctl -u sshd' to query the service