The fastest way to change your macOS username from Terminal

You can change your macOS username using Terminal without restarting into Recovery Mode, but the process depends on whether you want to change your short username (the one that appears in Terminal prompts and file paths) or your full display name (the one that shows on the login screen). Most people need to change the short username, which requires a few specific commands run in the right order.

The short username is harder to change because macOS ties it to your user account at a system level. You cannot straightforward rename it while you are logged in as that user. The most practical approach is to create a temporary administrator account, log out of your main account, then use that temporary account to rename your original account. After the rename is complete, you can delete the temporary account.

Key Takeaways

  • Your short username (used in Terminal and file paths) and your display name (shown on login screen) are separate things, and changing them requires different steps.
  • To change your short username, you must create a temporary admin account first, because you cannot rename your own account while logged in as it.
  • The Terminal commands involved are dscl (for the short username) and dscl again with a different flag (for the home directory), run from the temporary account.
  • After renaming, your old home folder path stays the same unless you manually move it, which is usually not necessary.
  • If you only want to change the display name on your login screen, you can do that in System Settings without Terminal.

Changing your display name (the straightforward way, no Terminal needed)

If you only want to change the name that appears on your login screen and in the top-right corner of your menu bar, you do not need Terminal at all. Open System Settings, click on your account name in the sidebar (usually listed under "General" or at the top), then look for a field labeled "Full Name" or "Display Name". Type your new name and close the window. This change takes effect when ready.

This is the display name only. Your short username — the one that appears when you type whoami in Terminal or shows in file paths like /Users/yourname — stays the same. If you need to change that short username, you will need to follow the Terminal steps below.

Creating a temporary administrator account

Open System Settings and navigate to "General" in the sidebar, then click "Users & Groups" (on older macOS versions) or look for "Users & Groups" under "System Settings" depending on your version. Click the lock icon in the bottom left and enter your password to unlock the settings.

Click the plus sign (+) to create a new account. Set the account type to "Administrator", give it a temporary name like "tempadmin", and create a password you will remember. Do not make it your main account — this is just a helper account you will delete later. Click "Create User" and wait for the account to be set up.

Once the temporary account exists, log out of your main account. On the login screen, select the temporary admin account and log in with the password you just created.

Using dscl to rename your short username

Now that you are logged in as the temporary admin, open Terminal. You will use the dscl command (Directory Service command line) to rename your original account. The command structure is:

dscl . -change /Users/oldusername RecordName oldusername newusername

Replace oldusername with your current short username and newusername with what you want it to be. For example, if your current username is "john.smith" and you want to change it to "jsmith", the command would be:

dscl . -change /Users/john.smith RecordName john.smith jsmith

Press Enter and wait for the command to complete. If it runs without showing an error, the rename worked. If you see an error like "record not found", double-check that you spelled your old username exactly right — it is case-sensitive.

Renaming your home directory path (optional but recommended)

Your home folder is still located at /Users/oldusername even though your account name has changed. This does not break anything, but it looks cleaner if the folder name matches your new username. To rename it, you need another dscl command:

dscl . -change /Users/newusername NFSHomeDirectory /Users/oldusername /Users/newusername

Again, replace the usernames with your actual old and new names. For the example above, it would be:

dscl . -change /Users/jsmith NFSHomeDirectory /Users/john.smith /Users/jsmith

After this command runs, you will need to manually rename the folder in Finder. Open Finder, navigate to /Users, right-click on your old folder name (john.smith in this example), and select "Rename". Change it to match your new username (jsmith). You may be asked for your password — enter it and proceed.

Logging back in and cleaning up

Log out of the temporary admin account. On the login screen, you should now see your original account listed with your new username. Log in with your password — it stays the same, only the username changed.

Once you have confirmed that everything works and you can log in normally, go back to System Settings and delete the temporary admin account. Click "Users & Groups", select the temporary account, click the minus sign (−), and confirm the deletion. You can choose to keep or delete the temporary account's home folder — since it was just a helper account, you can safely delete it.

What to do if something goes wrong

If you make a typo in the dscl command or something does not work as expected, the most common fix is to try the command again with the correct spelling. If you cannot log back in to your main account, you can still log in as the temporary admin account and try the dscl command again, or reverse it by swapping the old and new usernames.

If you renamed the home directory folder but the system is not recognizing it, log in as the temporary admin again and run the dscl command one more time to make sure the path is correct. In rare cases, you may need to restart your Mac for the change to fully take effect, especially if you renamed the home folder.

Frequently Asked Questions

Will changing my username affect my files or applications?

No. Your files stay in the same place, and applications continue to work normally. Some applications store settings tied to your username path, but most modern macOS apps handle this automatically. If you renamed the home directory folder to match your new username, the path updates and everything continues to work.

Can I change my username without creating a temporary account?

Not easily. macOS prevents you from renaming your own account while you are logged in as it. The temporary account method is the standard approach. Some older methods involved booting into Recovery Mode, but the temporary account approach is faster and less risky.

What if I forgot the password for my main account?

You can still use the temporary admin account to reset it. From the temporary account, open System Settings, go to "Users & Groups", select your main account, and click "Reset Password". You will be asked security questions or to use your Apple ID to verify your identity.

Do I have to rename the home folder, or can I leave it as the old username?

You can leave it as is. The home folder name and your short username are technically separate things. Renaming the folder is optional and mainly for cleanliness. If you skip this step, your home folder will still be at /Users/oldusername even though your account name is now the new username.

Will this change affect my Apple ID or iCloud login?

No. Your Apple ID and iCloud account are separate from your macOS username. Changing your local username does not affect your Apple ID, iCloud, or any cloud services. You will still log in to iCloud with your Apple ID email and password.