Repair user folder Permissions using terminal

Disk utility won't repair ownership & permmisions in the root user folder. I did a transfer of apps from my old Tibook and something went wrong. Some of my folders list "Owner" as unkown etc. I had this issue a few years back when restoring from a cloned drive, and someone on this forum suggested a Terminal command to reset my user folder back to defaults with the proper ownership and that worked! Unfortunately I can't remember the command line ("sudo chown...something like that). Changing permissions on each folder and file using the "get info" command is too tedious. Thanks for any help.

MBP 17in 2.33ghz Mac OS X (10.4.8)

TiBook 667 Mac OS X (10.3.7)

TiBook 667 Mac OS X (10.3.7)

Posted on Dec 7, 2006 8:29 AM

Reply
11 replies

Dec 7, 2006 4:04 PM in response to EWJ

Assuming your account is an admin account, run the following Terminal commands, replacing 'myusername' with your short user name:

sudo chown -R myusername ~
chmod -R ugo+rX ~
chmod -R u+w ~
chmod -R go-w ~
chmod 700 ~/Desktop ~/Documents ~/Library ~/Movies ~/Pictures
chmod 755 ~/Public
chmod 733 ~/Public/Drop\ Box


If your account is not-admin, there are a few additional steps you need to take before entering the above. Let me know if this is the case and I'll post them.

Dec 18, 2006 8:31 PM in response to Király

After entering the first command, terminal requested my password, which I sucessfully entered. I preceeded to enter the remaing command lines one at a time, pressed the enter key, the cursor advanced to the next line as if nothing or was processed. After entering everything, my get info windows still display ( Owner: unknown) etc. on some of my files and apps.

When I experienced this issue before, I entered a command line into terminal as direct through the discussion group, and Terminal started to process info, and my files and apps change to the correct Ownership & Permission, but I don't remember the exact Terminal command line.

Dec 18, 2006 8:49 PM in response to EWJ

Since the cursor advanced to the next line after entering each command, and no error message was returned, it sounds like the commands worked.

The Get Info panel is sometimes slow to reflect permissions changes. Try control-option-clicking Finder's Dock icon and select Relaunch. See if that kick-starts the Get Info permissions report.

You can verify that everything changed correctly by typing this into a Terminal window:

ls -laR ~ > ~/Desktop/list.txt

That will create a file on your desktop called list.txt. Open it with TextEdit. It will list every file and folder in your home directory. If your username is listed as the owner of everything then it worked correctly.

Dec 21, 2006 12:57 PM in response to EWJ

The commands I gave will only adjust permissions of items located in your user folder. It won't change any permissions of applications unless the apps are in your user folder instead of in /Applications.

Apple apps by default are owned by root and are writable by administrators. You can set up any application the same way by entering these into Terminal:

sudo chown -R root:admin [spacebar, drag app into Terminal window, press return, enter password when prompted]

sudo chmod ug+rwX [spacebar, drag app into Terminal window, press return]

Dec 31, 2006 1:24 PM in response to Paul Mullin

Assuming your non-admin account's username is "jim", and your admin account's name is "bob", log in to jim's account and enter these one at a time into Terminal:

su bob (press return, enter bob's password when prompted)
sudo chown -R jim:jim /Users/jim (press return, enter bob's password when prompted)
exit
chmod -R ugo+rX ~
chmod -R u+w ~
chmod -R go-w ~
chmod 700 ~/Desktop ~/Documents ~/Library ~/Movies ~/Pictures
chmod 755 ~/Public
chmod 733 ~/Public/Drop\ Box


That should take care of it.

eMac Mac OS X (10.4.8)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Repair user folder Permissions using terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.