Tuesday, 17 March 2015

How to change userID


hi there.

need change userid 501 1066 mach nfs share folder on remote server. did found solution snow leopard im running lion i'm not sure if it's same , dont want mess mac.

lot
 

sollution snow leo , lion

userid fixing

userid in macos , nfs share has mach!

first of all, don't while logged in user uid want change.
*
prerequisites
1 clean way of doing root user. that, have to*enable root user on mac os x. log in root described in apple's article.
*

not use sudo being loged in normal user if have admin privileges.*
*
change uid
read uid (given alice user's name, 501 old , 1234 new uid):
code:
# dscl . -read /users/alice uniqueid  uniqueid: 501     # dscl . -change /users/alice uniqueid 501 1234    # dscl . -read /users/alice uniqueid  uniqueid: 1234
*
change ownership of user's files
code:
# find /users/alice -user 501 -exec chown 1234 {} \;  # find /library -user 501 -exec chown 1234 {} \;  # find /applications -user 501 -exec chown 1234 {} \;  # find /usr -user 501 -exec chown 1234 {} \;  # find /private/var/ -user 501 exec chown 1234 {} \; 
or use 1 if sure no remote filesystem mounted

code:
# find -xl / -user 501 -exec chown 1234 {} \;  simple test if there files left owned old uid:  # find -xl / -user 501 -ls
rename special files , folders
not all. mac os x has special files , folders have (old) uid part of names. these include (on mac, ymmv):

/.trashes/501
/library/caches/com.apple.imagecaptureextension2.icadevicedatabase.501
/library/caches/com.apple.imagecapturenotifications.devicediscoverydatabase.501
/private/var/db/launchd.db/com.apple.launchd.peruser.501
, possibly files in /private/var/folders/ud/(some ugly dir name)/-caches-/
every of above have like:
# mv /.trashes/501 /.trashes/1234
 


Forums Macs macOS Older OS X Versions Mac OS X Lion (10.7)


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment