Nixbook Security Tip: Disable root Login

Warning Before starting ensure you have a non-root user with “wheel” permission

Run this as your user. If this fails check that your user has “wheel” permissions. Do not run as root or you might have to reinstall the OS.

sudo nano /etc/passwd

change this line

root:x:0:0:System administrator:/root:/run/current-system/sw/bin/bash

to

root:x:0:0:System administrator:/root:/run/current-system/sw/bin/nologin

Save the file and try to log in as root. If it fails you’re done!