Mac OS X: Change your User ID

Feb 19, 2009 - 14 Comments

Recently I connected my Mac to my linux based NFS server at home. I use NFS to access files from two other Linux boxes and on each server my UID (unique id) is set to 1000. In order for me to easily have full access to my NFS shares from OS X I changed my UID to match:
dscl . -change /Users/will UniqueID 501 1000
chown -R 1000 /Users/will

Remember to run the chown command afterwards, or you will not be able to access your home directory. Finally, log out and log in.

.

Related articles:

Posted by: William Pearson in Command Line, Mac OS, Tips & Tricks

14 Comments

» Comments RSS Feed

  1. Konrad says:

    I noticed that my root account is not ID=0.
    It’s because of this my Parallels Desktop might be having a problem starting. What should I do? manually change root ID to 0 or would it be safer to reinstall the OS?
    dscl . -list /Users UniqueID
    daemon 1
    Guest 201
    kon2 503
    nobody -2
    root 201
    I’m curious if this problem came about as I used TimeMachine backup to install my stuff on a new MBP.

  2. will fiveash says:

    After I changed my ID # as described above I used:

    $ sudo /bin/ksh # this is the shell I prefer
    # find -xL / -user 56290 -print0 | xargs -0 chown 121826

    This is much, much faster than having find exec chown a zillion times. Note, 56290 is ID # that I changed to 121826.

  3. […] OS X Daily Tweet Sin Comentarios Leer más […]

  4. Thanks for some other wonderful post. The place else may anyone get that type of information in such an ideal approach of writing? I have a presentation next week, and I’m on the look for such info.

  5. Thanks for the auspicious writeup. It in fact was a entertainment account it. Look complicated to more delivered agreeable from you! By the way, how could we be in contact?

  6. Roman says:

    There’s more to do to avoid problems. I wrote an article covering the whole procedure:
    http://www.inteller.net/notes/change-user-id-on-snow-leopard

  7. risaacson says:

    I can’t believe that no one also added doing a ‘find / -uid 501 -exec chown 1000 {} \;’. Leaving that step out just leads to other problems.

  8. […] UID del propietario será diferente, por lo que se puede cambiar a 1000 el UID del usuario de Mac siguiendo estas instrucciones (el inconveniente es que el usuario no aparecerá enumerado en la pantalla de […]

  9. Jack says:

    I changed my uid to 1000 in this fashion and upon doing so, it no longer appears among the available accounts in the login window. Instead, there is now an “Other…” option that I have to click through and manually enter user name and password. Hassle, but I’ll live unless someone has an idea to fix it.

  10. mam says:

    I’ve encountered some unexpected problems while following the above instruction in Snow Leopard (10.6.3).

    Prior to the changes, my account was the only active account (root and Guest Account were disabled, no other accounts exist) and therefore my account was the Admin account. After changing my UID from 501 to 502 (really, I have a good reason for doing this) @cj’s instruction did not work and I could not back out the change.

    I booted from the DVD and enabled the root account. Using root, I was able to execute @cj’s instructions and everything appeared to be fine.

    Everything was fine until I tried to unlock the System Preferences. I get the message “You must type an Administrators name and password to make changes to System Preferences”. I also found that I cannot execute “sudo” commands. I expect that this is because I am not recognized as an Administrator.

    My user name still has “Admin” underneath it, and “Allow user to administer this computer” is still checked.

    I’ve logged in with the root id, and unchecked and rechecked the “Allow user to administer this computer” box. I have also run Disk Utility | Repair Disk Permissions. None of these has fixed the issue.

    Any suggestions?

  11. Dirk Beckers says:

    Thank you for this informations! Many of my NFS-problems are solved now. But I still miss the “Linux/Ubuntu-way-of-configuring” if I’m using snowleopard…

  12. cj_ says:

    chown -R /Users/username is not sufficient: 1. It misses symlinks, and 2. If your main account is admin, your filesystem will be full of stuff owned by you. This should cover everything:

    find / \! \( -fstype hfs -or -fstype ufs \) -prune -or -user 501 -exec chown -h 1000 {} \; -print

    (replace 501 and 1000 with appropriate ID’s, and don’t forget the backslashes, they are important)

  13. kumar says:

    Remember to run the chown command afterwards, or you will not be able to access your home directory. Finally, log out and log in.

  14. I use NFS to access files from two other Linux boxes and on each server my UID (unique id) is set to 1000. In order for me to easily have full access to my NFS shares from OS X I changed my UID to match

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site