How can I find my admin username and reset password?

After updating the admin account username and full name, I cannot login to unlock the users&group preference.


I have tried to reset password by restarting Mac and command +r.


The result is I can login to Mac but still cannot unlock the user&group preference.


How can I get the admin username and reset the password?

Posted on Jan 13, 2018 7:52 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 15, 2018 10:00 AM

I'm not sure how you lost your admin account, but you can either add admin privileges to you account or you can create a new admin account. You will need to boot up in single user mode:


This page will tell you how to get into single user mode.

http://support.apple.com/kb/HT1492


Basically, you hold down the command + s key then powering on your machine. The command key has a little apple symbol on the lower left. It is between the alt/option key and the space bar. On a PC keyboard, it will be the windows key, I think.


to change your current id:

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.

# 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 /



->Start up some utility processes that are needed.

sh /etc/rc


->You will probably need to press the return key once the system stops typing.


figure out what to use as

$username_to_add

ls /Users

replace

$username_to_add with your short user name.
[ not sure if you need sudo in front.
sudo dseditgroup -o edit -a $username_to_add -t user admin
macos - How to add user to a group from Mac OS X command line? - Super User


[ this link shows adding the id to group wheel, but my administrator id is not in group wheel. ]



or you can create a new admin account.


Get the Mac to set up an additional administrative account. You can then change the password on your old account. This will work all all releases of Mac OS X so far.


Start with your computer power off. Hold down command-s. Power on your computer.


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.

# 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 /


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.

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!!

4 replies
Question marked as Top-ranking reply

Jan 15, 2018 10:00 AM in response to Johnsonyau

I'm not sure how you lost your admin account, but you can either add admin privileges to you account or you can create a new admin account. You will need to boot up in single user mode:


This page will tell you how to get into single user mode.

http://support.apple.com/kb/HT1492


Basically, you hold down the command + s key then powering on your machine. The command key has a little apple symbol on the lower left. It is between the alt/option key and the space bar. On a PC keyboard, it will be the windows key, I think.


to change your current id:

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.

# 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 /



->Start up some utility processes that are needed.

sh /etc/rc


->You will probably need to press the return key once the system stops typing.


figure out what to use as

$username_to_add

ls /Users

replace

$username_to_add with your short user name.
[ not sure if you need sudo in front.
sudo dseditgroup -o edit -a $username_to_add -t user admin
macos - How to add user to a group from Mac OS X command line? - Super User


[ this link shows adding the id to group wheel, but my administrator id is not in group wheel. ]



or you can create a new admin account.


Get the Mac to set up an additional administrative account. You can then change the password on your old account. This will work all all releases of Mac OS X so far.


Start with your computer power off. Hold down command-s. Power on your computer.


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.

# 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 /


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.

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!!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I find my admin username and reset password?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.