Disable root account

You might want to disable your root account from logging in.

1. Disable the account (remove password)

$ sudo passwd -d root

2. Lock the account (adds ! to /etc/shadow)

$ sudo passwd -l root

Now logging in as root shouldn't be possible, but you can still elevate to it with sudo su.


Revision #2
Created 10 October 2021 16:06:21 by Marek
Updated 10 October 2021 18:07:09 by Marek