Changing the short user name

Discussion in 'Apple' started by Michelle Steiner, Mar 28, 2008.

  1. This keeps popping up here. MacWorld has written an excellent article
    on the subject; it is Leopard oriented, but contains a link to a utility
    for Tiger.

    The article, which contains links and graphics, is at
    <http://www.macworld.com/article/132693/2008/03/changeshortusername.html>

    Here it is sans said links and graphics:

    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:



    1. 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.)

    2. 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.

    3. 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.

    4. In the Advanced Options screen, click the plus (+) button under
    Aliases and then type your desired account alias. (Do not make any other
    changes.)

    5. 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).


    The Advanced Options screen of Accounts preferences

    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:
    1. 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.

    2. Log in as a different user than the one you want to modify.

    3. Open the Accounts pane of System Preferences.

    4. 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.

    5. 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.

    6. 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.)

    7. Click on OK and close System Preferences.
    8. 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.

    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:
    1. 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.

    2. Log in as a different user than the one you want to modify.

    3. Open the Accounts pane of System Preferences.

    4. 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.

    5. 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.

    6. In the Advanced Options screen, delete your current short username
    in the Short Name field, and then type in your desired new short
    username.

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

    8. Click on OK and close System Preferences.

    9. Open Terminal (in /Applications/Utilities).

    10. 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.

    11. 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.

    --
    Support the troops: Bring them home ASAP.
     
    Michelle Steiner, Mar 28, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oxford
    Replies:
    9
    Views:
    245
    Obfus Kataa
    Jan 23, 2004
  2. MacFan
    Replies:
    2
    Views:
    206
    MacFan
    Mar 25, 2006
  3. Jd Lyall
    Replies:
    2
    Views:
    180
    Michelle Steiner
    Oct 25, 2007
  4. André
    Replies:
    5
    Views:
    221
    André
    Jan 7, 2008
  5. Mirsky
    Replies:
    10
    Views:
    379
    Michelle Steiner
    May 29, 2008
Loading...

Share This Page