A renaming of the root user

Discussion in 'Mac Apps and Mac App Store' started by big, Aug 14, 2003.

  1. big macrumors 65816

    big

    Joined:
    Feb 20, 2002
    #1
    just bought a 1ghz TiBook, I was going to reformat the drive and reload all the software, but my reseller did that for me upon receipt of the used laptop....

    now I have 3 questions

    1. how do I rename a user (ie the short name)

    2. How do I know the Admin user is "Root"

    3. How do I enable a user as root?
     
  2. shadowfax macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #2
    the admin is never "root" per se. you can enable root, and i suppose there is probably a way to give an admin root privileges, but you can do nearly everything you could ever want to do with just an admin account. you can even get into the terminal as a root account, which i often do (the command is sudo -s)... but i wouldn't spend any time as a root user if i were you. it makes your computer much more vulnerable to viruses, hackers, etc.

    as to changing names of accounts, if you go to sysprefs and then to "accounts" (NOT "my account"), and then click on your username, and then "edit," a menu will pull down, allowing you to change everything about yourself.
     
  3. mnkeybsness macrumors 68030

    mnkeybsness

    Joined:
    Jun 25, 2001
    Location:
    Moneyapolis, Minnesota
    #3
    1. the shortname cannot be changed by ordinary means...i'm not sure if it can be done in the terminal or not.

    2. no admin user is the root user.

    3. root user is enabled in the netinfo manager in /applications/utitlities/ ... then to log in as root, you would use the username "root" and password is whatever you set it as in netinfo.

    edit: sorry, shadowfax posted before i finished typing mine.
     
  4. shadowfax macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #4
    guess i have to eat my words on that last bit about changing the account info...

    i would create a new admin account, log in, run terminal, gain root access (sudo -s), and then copy the old user folder into my own (cp -rf /users/oldname /users/newname/temp), then remove the old user (via the accounts in sysprefs), and copy all the files you want from the new temp file in your own user folder, and delete the rest. i recommend you make new ~/library files instead of copying the ones from the other user.
     
  5. big thread starter macrumors 65816

    big

    Joined:
    Feb 20, 2002
    #5
    sorry, I was trying some of that, until the finder bombed, and I decided to start clean anyways

    though here is the responce from huntsville's Mac Resource


    1. how do I rename a user (ie the short name)
    Easiest way to change the short name is to create a new user, make him an admin, login as that user, delete the old user.


    2. How do I know the Admin user is "Root"
    The admin is never root. You must login as root


    3. How do I enable a user as root?
    Launch NetInfo Manager, go to the menu Security, select Authenticate, type in your password, go back to Security, select "Enable Root User", type in the password you want for root. Now logout, and login as root using your new password.
     
  6. shadowfax macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #6
    yeah, those are all the same answers we eventually gave you. once again, i cannot stress enough that it is not a smart idea to spend any more time than you need to logged in as root. if you have anything important on your computer.
     
  7. rainman::|:| macrumors 603

    rainman::|:|

    Joined:
    Feb 2, 2002
    Location:
    iowa
    #7
    Yes, not to be rude (honestly), but frankly if you have to ask, you shouldn't be playing around in there. Unless you have extensive UNIX experience with root. There's no reason to log in as root, and virtually no reason to even use sudo... The OS is built around the idea that the user will never use root or sudo, so it can have adverse reactions to say the least...

    pnw
     
  8. simX macrumors 6502a

    simX

    Joined:
    May 28, 2002
    Location:
    Bay Area, CA
    #8
    You can actually change the short name of a user through the NetInfo Manager utility. The thing about creating a new account, and then deleting the old account is that your old files won't have the correct permissions assigned to them, so you'll either have to run Disk Utility to repair your permissions after the change, or you may risk not having the correct permissions and causing problems (not to mention security breaches). I currently am using a user on my Mac at work which originally had a different user name, and I have had absolutely zero problems after doing the change.

    I'd actually recommend going through this series of steps if you just want to change your short user name -- no Terminal experience required (or even necessary), and you'll have the benefit of a new short user name and preserved permissions. :)

    NOTE: You will need to be logged in as an administrator user (or have access to an administrator log/pass) in order to perform this change. I would also highly recommend quitting all other applications, to avoid saving data in your existing home folder which is soon to become your non-existing home folder.

    Here are the steps to accomplishing this change:

    1. Open up NetInfo Manager, located in /Applications/Utilities .

    2. When the NetInfo Manager window first opens on startup, "/" should be selected in the first column. Select "users" in the second column.

    3. Now, locate and select your current short user name. Mine was originally "samuil".

    At this point, we have a bit of a problem. When changing your info, you're going to need to change the actual location of your home directory first. This shouldn't cause any problem even if you're running under the current user. The next few steps will show how to do this.

    4. Open up the directory /Users in the Finder.

    5. Deselect all user folders, and then open the Get Info window. This should get info on the Users folder.

    6. Reveal the "Ownership & Permissions" pane. Note the current ownership permissions. My Users folder ownership/permissions settings are as follows, and as far as I know, are correct.

    PHP:
    Ownersystem
    Access
    Read Write

    Group
    wheel
    Access
    Read Write

    Others
    Read only
    If the correct permissions are different, let me know.

    7. Click the lock in the Ownership & Permissions pane, and then change the owner from "system" to your current short user name (in my example, this was "samuil"). You will now be prompted for an administrator password, which is required to continue.

    8. Switch to the /Users folder window in the Finder. Click your home folder once to select it, press Enter to begin renaming it. (Your current home folder should NOT have a generic folder icon -- the icon should look like a house.)

    9. Change the name of your current user folder to your desired short name, *NOT* your full name (the correct new short user name, in my example, is "simmy"). Press Enter again to confirm the folder name change.

    10. Switch to the Get Info window on the /Users folder, and reset the permissions to what they were. That is, change the owner back to system, and then click the lock to lock it.

    11. Now, switch to the NetInfo Manager application. Click the lock at the bottom of the window -- you'll be prompted for your administrator password.

    12. In the bottom pane where it lists the properties and their associated values for your current user, change all instances of your old short user name to your new short user name. For example, I changed all instances of "samuil" to "simmy".

    I see a total of 6 values that need to be changed: "_writers_hint", "_writers_passwd", "name", "_writers_tim_password", "_writers_picture", and "home". For the "home" value, do NOT change it to just say your short user name -- you need it to say "/Users/newshortusername" where "newshortusername" is your new short user name, obviously.

    The values that I listed above vary from system to system, so they may not all be there. If they aren't, don't worry about adding them -- just change the ones that are there that need to be changed.

    13. Click the lock at the bottom of the NetInfo Manager window, and then press Command-S or choose "Save Changes" from the Domain menu to confirm your changes.

    14. Log out, and log in. Your old short user name will no longer be valid, but your new short user name and old full name will still work. The same password you used under your old short user name will also work -- the password has not changed. Note that if you do not log out, a new home directory under your old user name may be created in the Users folder even though there is no longer a user associated with that folder. So once you perform the above steps, it is highly recommended that you immediately log out to prevent any future problems.

    That's it! Your correct permissions will be preserved, because UNIX actually uses the user ID (the "uid" field in NetInfo Manager) to assign permissions, not the short user name. So changing the short user name won't affect your permissions, whereas deleting a user and then creating a new one will (because the new one will probably have a new user ID).

    Hope that helps!
     

Share This Page