Access other users' folders via the Finder

Jul 06, '04 09:06:00AM

Contributed by: SOX

Statement of problem: You have a set of users that want shared access to each other's documents, pictures, and movies folders. The Unix groups system is designed to do exactly this, and if everyone grants group access privileges, then all members of the group can access the folders. In the Terminal, that is. In the Finder, I always see a little red minus sign on the folders in another user's directory, telling me I cant access them. Well, here is one way to get around this ... but I can't help feeling like there must be some official way to do this via NetInfo or something. So if you know another method, lets hear it!

Lets say user1, user2, and user3 already belong to the same group, staff. We can set the group permission to all their files like this:

chgrp -R g+wrX  staff  ~user1 ~user2 ~user3
That grants read, write, and execute access recursively to all the users' files and folders, to anyone in the group staff. You obviously can be more selective as needed. Now here is the trick that grants access in the Finder: Create a directory somewhere, such as /Users/Shared, for each of your users:
% cd /Users/Shared
% mkdir user1  user2 user3
% chmod g+wxr staff user1 user2 user3
% ln -s /Users/user1/* user1/
% ln -s /Users/user1/* user2/
% ln -s /Users/user1/* user3/
This step creates a set of Unix symbolic aliases that "mirror" the contents of each user's actual home directory. Now to use the Finder to access user1's stuff, go to /Users/Shared/user1. It will have everything you want, but no red minus signs on the folders barring your access.

Of course, this does not dynamically update the contents of the ~user* folder when the user adds new files and folders to the top level. But you can re-execute the above at anytime to refresh it, or for added kludge, please make a folder-action script to do it for you.

[robg adds: I haven't tested this one ... there's an older hint with some similar, but not identical, discussion.]

Comments (6)


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