Changing my administrator user's username has removed privileges I've taken over my wife's Mac mini running osx high sierra. 
I was in a rush and went into system preferences, clicked on the current user (advanced options), which was named 'user', which was also the administrator, and changed the name to 'grant'. This didn't end up changing the username. I then tried to create another administrator user called 'grant'. 

I logged out. When I logged back in the only user available to log in with was 'user'. When I opened user preferences I see that 'user' is no longer an administrator.

I now have no way of accessing an administrator. When I try move files into the applications folder it asks for admin username and password. I've tried every combination of 'user' and 'grant' and nothing works.

Any help getting me access to an admin user will be appreciated.



Here is the screen where I try remove the file in single user mode
If it's not already, make sure your Mac mini has an up-to-date backup.

Then follow these steps:


Shut down your Mac mini
Power up your Mac mini and immediately press and hold the command + S keys
Keep the keys down until you see text on the screen
Now enter the following command:

/sbin/fsck -fy 

and press enter
Next enter the following command:

/sbin/mount -uw / 

and press enter
Now enter the following command:

rm /var/db/.AppleSetupDone 

and press enter
Finally, enter the reboot command

and press enter


Your Mac mini should reboot and you can log in normally, after which point the Setup Assistant will launch. Now you need to create a new admin user. Don't worry, your other user accounts should be intact.  NOTE: You should choose a new user name for this admin account.

Once you're back up and running you can go to Apple > System Preferences > Users &amp; Groups and select the Allow user to administer this computer checkbox for the 'grant' user.