I wanted to change my mac's name so I changed the "computer name" in SHARING and also the "account name" and "full name" in USERS & GROUPS. Only thing is I didn't change the "home directory".

enter image description here

Now I cannot make any changes to my mac that require hitting the little lock and enter my details. Nothing works. And I get the "not in the sudoers file" error when I try to fix my problem through the terminal... I think my mistake was to NOT change the "home directory" along with the account name and full name? I was worried making changes to the directory might alter more than I wanted.

Please help me!


Changing an account name in the Users & Groups preferences pane is (as you've found out the hard way) not recommended unless there already exists on the system another account with Admin level permissions so the resulting issues can be fixed. You might be able to resolve this by activating the root account following instructions given here: https://support.apple.com/en-us/HT204012, then editing the sudoers file using vi in terminal to add your current username as shown below.

(from my sudoers file:)

User privilege specification

root ALL=(ALL) ALL

%admin ALL=(ALL) ALL

[new username][doublespace here]ALL=(ALL) ALL

Save the edited sudoers file then restart and see if using the new username account to login & make any other fixes to permissions that might be necessary.

  • Hi! Thanks for your reply! Unfortunately I cannot proceed with your solution because it requires me to hit the lock and enter an administrator name and password in order to enable the root user... – mat83400 May 17 '20 at 0:38
  • I you're still stuck without an admin account, try this method to create a new Admin account (answered by "grg"): apple.stackexchange.com/questions/164331/… – KarlC May 23 '20 at 7:19

You must log in to answer this question.

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