Protect pre-OS X files and folders

Nov 30, '01 06:50:23PM

Contributed by: Anonymous

I wanted to restrict other users' access to folders that existed prior to my upgrade to OS X, like the subfolders in my home folder.

Files and folders that were on the hard disk prior to upgrading to OS X are not assigned to a user or group. They take on ownership by whatever user is logged in. Using the Finder: Show Info to change the Privileges does not work. Any user logging in is listed as the owner with rw, r, r privledges. Group is usually "unknown."

To restrict access, you can log in as the user you want to own the files and copy them. Then delete the original. A faster method can be done via Terminal using "chown". You must sudo to use this command:

sudo chown [user shortname] filename
I did this to a folder and, voila, logging in as a different user I couldn't open the folder and got the "do not enter" folder icon.

For neatness' sake, you can also change the group [Editor: chown username:group filename]. The group is usually "Staff", but check out an existing file's privileges first.

I think an option for chown will change all files below "filename" but I haven't tried it. [Editor: use the "-R" option on chown]

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20011130185023429