One of the most-frequently-asked questions about Mac OS X is “How do I change my short username?” While it’s easy to change your full username—an easily-accessible setting in Accounts preferences—the short username, which is also the name of your home folder in the Finder, seems set in stone (or in silicon, if you will).
And in previous versions of Mac OS X, that was nearly the case: changing your short username was a complicated—and risky—procedure. In fact, it was so complex that even Apple’s own instructions weren’t exhaustive. (Because of this, a colleague and I wrote a special utility for pre-Leopard versions of OS X, ChangeShortName, that did the job right.) But in Leopard, Apple has finally given users a reasonably-simple way to change the short username, and it’s located right in System Preferences—assuming you know where to look. Even better, you have three options, of varying levels of complexity and risk, for making the change; all three are considerably safer than the unauthorized procedures you had to use in the past.
Why would you want to change your short username? Maybe you too-casually accepted the Setup Assistant’s suggestion when first configuring your Mac, and that “short” name isn’t really short; perhaps you’ve got two Macs and want the same short username on both; or maybe you inherited a Mac from someone and would prefer to change the name of an existing account instead of creating a new one.
Whatever the reason, you just want a change, and we’re here to help with the rundown on each procedure. Note that whichever approach you take, the steps must be performed from an administrative user account. And, of course, you should always have a good backup before you go mucking around with user accounts.
The simple approach: account aliases
If the main reason you want to change your short username is to reduce how much you need to type in name/password dialogs—for example, when logging in to your account or when performing actions that require administrator authentication—Leopard offers an easier solution: account aliases.
Like an alias in the Finder, which refers to an original file, and essentially functions as that original file when accessed, an account alias refers to an actual account name, and functions as that account name when typed. For example, if your name happens to be Englebert Rumplestiltskin and the OS X Setup Assistant kindly made your short username englebertrumplestiltskin, you can create an account alias of rumple; whenever you’d normally type englebertrumplestiltskin, you can type rumple, instead.
To create an account alias, follow these steps:
- Open the Accounts pane of System Preferences. (You can do so from within your own account or from another account; you just need administrative access.)
- If the lock icon in the lower-left of the Accounts window is “locked,” click on it and provide an administrative username and password; this allows you to make changes.
- In the list of accounts on the left, right-click (or Control-click) on the name of the account you want to modify and choose Advanced Options from the resulting menu.
- In the Advanced Options screen, click the plus (+) button under Aliases and then type your desired account alias. (Do not make any other changes.)
- Click on OK.
Although your new account alias may be usable immediately, I recommend restarting just to be sure all of OS X’s services are aware of it. From now on, any time you’re asked for your username and password, you can type your account alias instead of your actual short username. You can even access your personal Web Sharing Web site using your account alias (for example, http://yourIPaddress/~alias
).
Advantages: Easiest procedure; absolutely safe; can log in and access shares via the alias; can connect to Web Sharing files via the alias; few, if any, side effects.
Disadvantages: Doesn’t actually change your short username; doesn’t change the name of your home folder in the Finder; File Sharing shares still use your original username; possible security implications by having multiple login names.
The middle ground: changing just your short username
The next step up in complexity is to actually change your short username, but to leave your home folder (in the Finder) alone. This would let you log in using the new short username, and any dialogs in which your short username is automatically filled would use the new name, but your home folder in the Finder will still reflect your original name.
One potential issue to be aware of here: Some programs may store settings or preferences based on your short username. If you change that name, you may find that particular programs, and possibly even some OS X services, exhibit minor issues after making the change. The solution is usually as simple as viewing the settings interface for the offending program or service and changing whatever setting is causing the problem.
Here are the steps to follow:
- If Automatic Login is enabled (in Accounts preferences) for the account you’re modifying, disable it. Similarly, if File Vault is enabled (in Security preferences), disable it. You can re-enable these features, if desired, after completing the procedure.
- Log in as a different user than the one you want to modify; make sure the account you want to modify is not logged in.
- Open the Accounts pane of System Preferences.
- If the lock icon in the lower-left of the Accounts window is “locked,” click on it and provide an administrative username and password; this allows you to make changes.
- In the list of accounts on the left, right-click (or Control-click) on the name of the account you want to modify; choose Advanced Options from the resulting menu.
- In the Advanced Options screen, delete your current short username in the Short Name field, and then type in your desired new short username. (Do not make any changes to the Home Directory field.)
- Click on OK and close System Preferences.
- Restart your Mac.
After restarting, your original short username will no longer be valid; you’ll need to use your new name exclusively. Mac OS X automatically updates any groups to which your account belongs, and changes the path to your personal Web Sharing directory (for example, http://yourIPaddress/~newusername
).
TIP: If after changing your account name, you find yourself occasionally typing your original username by accident, you can use the first procedure, above, to add your old name as an alias to your new one.
Advantages: Relatively safe; your actual short username is changed; avoids problems with preferences and applications that store settings based on the path to your home directory; Web Sharing directories reflect your new username.
Disadvantages: Doesn’t change the name of your home folder in the Finder or the name of File Sharing shares; can cause minor issues with preferences and application that store data or settings based on your short username.
The full monty: changing your short username and the name of your home folder
If the thought of your username and the name of your home folder in the Finder being different offends (or confuses) you, or if you want your home directory’s name to match your username when accessing your account over File Sharing, you want to change both your short username and your home folder name.
Although this procedure is more complete than the previous one, it has caveats of its own. In addition the issue mentioned above with respect to programs that store settings based on your short username, there are also programs—in fact, more programs—that store settings or preferences based on the path to your home folder. If you change the name of your home folder, that path changes (from /Users/oldname to /Users/newname) and, thus, those settings are no longer valid. However, as before, the solution is usually as simple as viewing the settings interface for the offending program or service and changing whatever setting is causing the problem.
Finally, changing the name of your home folder also has ramifications for Time Machine, which tracks files based on their paths. If you change the name of your home folder, the path to every file in your home folder changes, so Time Machine will back up every file again.
If you still want to go all the way, here are the steps to follow; note that these instructions assume your home folder is located in /Users
:
- If Automatic Login is enabled (in Accounts preferences) for the account you’re modifying, disable it. Similarly, if File Vault is enabled (in Security preferences), disable it. You can re-enable these features, if desired, after completing the procedure.
- Log in as a different user than the one you want to modify; make sure the account you want to modify is not logged in.
- Open the Accounts pane of System Preferences.
- If the lock icon in the lower-left of the Accounts window is “locked,” click on it and provide an administrative username and password; this allows you to make changes.
- In the list of accounts on the left, right-click (or Control-click) on the name of the account you want to modify; choose Advanced Options from the resulting menu.
- In the Advanced Options screen, delete your current short username in the Short Name field, and then type in your desired new short username.
- In the Home Directory field, change
/Users/oldusername
to/Users/newusername
, where oldusername is your original short username and newusername is your new short username. Make note of the original and new paths. - Click on OK and close System Preferences.
- Open Terminal (in /Applications/Utilities).
- Type the following command, all on one line, and then press Return; when prompted, provide the password of the admin account you’re currently using, and then press Return again:
sudo mv /Users/oldusername /Users/newusername
(These are the original and new Home Directory paths from Step 7; oldusername is your original short username and newusername is your new short username.) This step renames your home folder in the Finder. - Restart your Mac.
After the restart, your short username is completely changed, at least as far as Mac OS X is concerned—both your account name and the name of your home folder in the Finder have been updated.
One specific issue you may experience after performing this procedure is an inability to access Web Sharing for the modified account at http://yourIPaddress/~newusername
; instead, you may see a “forbidden” or “403” error. (I tested the above procedure many times for this article and experienced this issue only once.) If this happens to you, follow the procedure in
this Apple Support article; note that in Step 16 of the article, shortname means your new short username.
TIP: If after changing your account name, you find yourself occasionally typing your original username by accident, you can use the first procedure, above, to add your old name as an alias to your new one.
Advantages: Both your short username and your home folder in the Finder are changed; nearly-complete method of changing your short username.
Disadvantages: Can result in minor issues with services and applications that store their settings or data based on your short username or the path to your home folder; you may need to fix Web Sharing for it to recognize the change in your home directory.
Change challenges
You’ll notice that I called even the full-monty method a “nearly-complete” one. Primarly because of the potential issues I mentioned above with respect to settings, especially among third-party software. But also because I’m hedging a bit: In the past, Apple has stored a good number of user-level settings, and even a few system-level settings related to users, as references to users’ home directories; when working on ChangeShortName, my colleague James Bucanek and I regularly discovered, and had to account for, minor issues relating to such settings.
The good news is that many of the OS X settings that would break when you changed the short username in Tiger—even ones using home-directory paths—are automatically updated by the OS when you change the short username in Leopard. I’ve been pleasantly surprised by how well Leopard’s tools work.
Senior Editor Dan Frakes has been helping people change their OS X short usernames since 2003.
UPDATE 3/28/2008, 6:25pm: Added note about Time Machine and changing the name of your home folder.