Changing Your Shortname In OS X

From MacShadows KB

Jump to: navigation, search



This is a guide on how to change the shortname of your account in OS X. Some of you are probably thinking "What is my shortname?". Your shortname is what the Operating System identifies you as, along with your UID and GID. Basically it's your UNIX username, also the name of your home folder. Mac OS X usually concatenates your real name into a short name when you first setup your Mac. (Example: If my real name in OSX was John Smith, OSX's default shortname would be johnsmith) A lot of people aren't aware they can't change this "easily" from preferences, or think it's insignificant only to find out later, that is not the case. For those who have some horrible shortname or just feel like changing it, this guide is for you.

How to Change Your Shortname


Obviously, doing things manually is not for everyone. I suggest you take advantage of the link(s) below. If you know of any other programs that perform this task, feel free to add them.


ChangeShortName 1.3

Mac OS X Power Tools


First, create an account with the short name you want through the Accounts pane in preferences. (or nicl, but why use that?), make sure they're admin, unless you don't want your account to be admin when you get a new short name.

Make sure that auto-login is disabled, Do NOT log in as the new user yet!

Use Netinfo Manager or nicl to change the new user's UID and GID to the same value as the old user. (As far as the computer is concerned, both users are now effectively the same user.) In this case I prefer nicl. Open and enter the following commands, pressing return after each (don't include the < and >):


This is to figure out what UID and GID you're working with.

 sudo nicl . -create /users/<new user> uid <old user uid>

This changes the UID for the new user to the old user's UID.

 sudo nicl . -create /users/<new user> gid <old user gid>

This changes the GID for the new user to the old user's GID

Throw away the new user's home folder (which should be the nearly empty).

Restart and boot into SUM (Single User Mode) to change the old home folder name to the new user's shortname.

Enter the following commands:

 mount -auw

This mounts the filesystem for writing.

 mv /Users/<oldname> /Users/<newname>

This renames the old home folder to the new user's home folder


Freakin' obvious..

Now you should be back in the GUI as the new user with the same ID and same home folder. Go into Netinfo Manager again and delete the old user or delete it with nicl.

nicl . -delete /users/<old user>
nicl . -delete /groups/<old user>

And there you are, hopefully there are no errors!

Personal tools