Mac OS X: Change your User ID

Feb 19, 2009 - 13 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.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

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

13 Comments

» Comments RSS Feed

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

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

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

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

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

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

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

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

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

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

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

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

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

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

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