Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Can't log in after changing user name

Hello,


I have a iMac with MacOS High Sierra version 10.13.6 (not sure if that is relevant) that I tried to change the username on, after making an uneducated attempt I've been logged out of the system preferences. I was still able to log in and out of the computer though.


I basically opened up System Preferences > User & Groups > Unlocked > Advanced settings


Then I changed the Group, the Account Name and the Full Name.


I then logged out and restarted the computer. Once restarted the old name was still up and I was able to log in. I tried to log back into advanced settings and the window that pops up asking for credentials doesn't open up with a name automatically in it anymore, and no combination of password and user name let's me in.


I tried changing the password under Users & Groups and still nothing.


How can I fix this issue?


Thanks in advance.

Posted on Jan 13, 2020 8:41 PM

Reply
Question marked as Best reply

Posted on Jan 13, 2020 9:16 PM

Do you have a backup you can use to restore the system? That would be the easiest way to recover.


If you have another admin user account, then you can revert the changes you made.


Here is an Apple article on how to properly change a user account name:

https://support.apple.com/en-us/HT201548


If you do not have another admin user account, then open the Terminal in Recovery Mode and force macOS to run Setup Assistant the next time you restart the computer. You need to run the following command making sure to replace "Macintosh HD" part with the correct volume name for your regular boot volume:

rm  -i  "/Volumes/Macintosh HD/var/db/.AppleSetupDone"


You will be prompted to confirm or decline deleting the file. Press either "y" or "n" respectively and press the "Return" key to submit the response. After deleting this file you can reboot the computer to be presented with Setup Assistant which will have you create a new admin user account which you can then use to fix your other account.


I used "Macintosh HD" in my example because that is the default name macOS uses. However, if you have changed the volume name or if you are unsure of the correct name for your regular boot volume you can locate it by using the following command:

mount  |  grep  -i  volume


You should always have good verified working backups especially when making critical system changes. Also plan ahead to make sure you can recover a non-booting system.

Similar questions

2 replies
Question marked as Best reply

Jan 13, 2020 9:16 PM in response to ymaia19

Do you have a backup you can use to restore the system? That would be the easiest way to recover.


If you have another admin user account, then you can revert the changes you made.


Here is an Apple article on how to properly change a user account name:

https://support.apple.com/en-us/HT201548


If you do not have another admin user account, then open the Terminal in Recovery Mode and force macOS to run Setup Assistant the next time you restart the computer. You need to run the following command making sure to replace "Macintosh HD" part with the correct volume name for your regular boot volume:

rm  -i  "/Volumes/Macintosh HD/var/db/.AppleSetupDone"


You will be prompted to confirm or decline deleting the file. Press either "y" or "n" respectively and press the "Return" key to submit the response. After deleting this file you can reboot the computer to be presented with Setup Assistant which will have you create a new admin user account which you can then use to fix your other account.


I used "Macintosh HD" in my example because that is the default name macOS uses. However, if you have changed the volume name or if you are unsure of the correct name for your regular boot volume you can locate it by using the following command:

mount  |  grep  -i  volume


You should always have good verified working backups especially when making critical system changes. Also plan ahead to make sure you can recover a non-booting system.

Can't log in after changing user name

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