4

What happens if you run

sudo deluser root

will sudo still work, and will the system still work?

0

1 Answer 1

5

You can't delete an user if there are processes currently running as that user, which in the case of root, is always. You could manually delete the entries in /etc/{passwd,shadow,group}, but depending on the settings in /etc/nsswitch.conf, there might be alternate sources of the root account, so things will continue to work. If you then remove the alternate sources in /etc/nsswitch.conf so that only these files are used (by keeping only compat):

passwd: compat
group: compat
shadow: compat

Then things will start to break:

$ sudo -i
sudo: unknown user: root
sudo: unable to initialize policy plugin

It might even lead to an unbootable system; you'll have to go back and fix with a live USB or single user mode.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .