I tried renaming my root user account and for a second after saving it looked like it had no name whatsoever. That was the last time I could use the "lock" icon under Users & Groups.

I followed some instructions by rebooting in CMD+S mode and basically using passwd command to reset it which allowed me to log in but I'm still powerless to use anything that requires admin privileges.

For instance, the "put in your root password" dialogue box is no longer pre-filled with my account name and no variation of the name seems to work.

Using sudo in the terminal results in:

~/lab ~ sudo nano /etc/sudoers
johnnyuser is not in the sudoers file.  This incident will be reported.

What do I do to restore things to the way they were before?

  • In single user mode, edit the /etc/sudoers file by adding the line johnnyuser ALL=(ALL) ALL to the file – Allan May 8 '18 at 17:43
  • 1
    Since the incident was reported I would wait until the Chief Security Manager enters the room and ask him/her to fix the problem. :-) – klanomath May 8 '18 at 17:55

This question has been answered here: Changing my administrator user's username has removed privileges

I had this issue as well and it worked for me.

| improve this answer | |

I you changed you password from secure mode (CMD+S) then try

sudo su -> then type your password nano /etc/sudoers

| improve this answer | |
  • Could you explain this syntax a little better? No variations of this are working for me. – dsp_099 May 8 '18 at 17:37
  • 2
    How can you use sudo su when you're locked out of sudo in the first place? – Allan May 8 '18 at 17:39

You must log in to answer this question.

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