I lost admin access when I tried to change user name on my Mac. I have entered into single user mode, entered all the commands suggested (including the spaces) and it isn't working. It continues to reboot with zero change. What can I do? I'm open to all suggestions.
did you do the single person commands? did you type them correctly?
/sbin/mount -uw / rm /var/db/.applesetupdone
I have been in the same state last year when I also did the same i.e. tried changing admin user name. I am not much of a software geek so I resorted to the brute force method, installing the new copy of the macOS. I was running High Sierra at that time.
I followed this apple support link and most probably installed a clean version of latest macOS available by holding cmd+R at startup.
If you can backup your Mac now, it would save a lot of work.
Follow this tutorial to backup to a hard disk. It uses disk utility, time machine and by holding cmd+R during startup, you can go to recover from a time machine backup.
Get the Mac to set up an additional administrative account. This will work in all releases of Mac OS X so far.
You need to get into single use mode for steps one and two that are listed below. Start with your computer power off. Hold down command-s. Power on your computer. Continue holding down command-s until you see some text on the screen.
This page will give more details on how to get into single user mode. http://support.apple.com/kb/HT1492
Type in the following:
The first two commands will depend on your release of Mac OS X. Look at what is typed out in the console to determine the exact format. You do not need to type in the lines beginning with an ampersand, #, they are comments.
# Type the follow two instructions to access the startup disk in read/write. # Press return after each command. # in case of partial success repeat this command until errors go away. /sbin/fsck -fy /sbin/mount -uw / # Get setup to activate a new administration account cd /var/db pwd #List all files. The l is a lower case L. ls -a # The move command acts as a rename command in this format. # In Yosemite, this file is zero bytes. # the disappearance of .AppleSetupDone causes a new administration account # to be added the next reboot. mv -i .AppleSetupDone .AppleSetupDone.old # reboot your mac shutdown -r now
Once you've done that the computer reboots and it's like the first time you used the machine. Your old accounts are all safe. From there you just change all other account passwords in the account preferences!! macOS will ask you to create a new admin account.
Limnos adds a detailed explanation: http://discussions.apple.com/message.jspa?messageID=8441597#8441597