Sharing a single Dropbox between multiple accounts on one Mac - possible?
This seems like it should be easy, but...
My partner and I use a single Dropbox.com account to keep all of our joint projects synced up between our computers - and this has been working great for years. We've now added a MacBook Air to the mix, and we each have accounts on it and can grab it and go when we need to do some remote work.
I've been trying to get the Dropbox synced to the Air - but I want to have it in the "Shared" directory so that we both can access it - it shouldn't matter who is logged in. This doesn't seem to be working.
I can located the Dropbox in the shared directory fine - but when I change the user who is logged in that user has no permissions to sync the Dropbox or access the files.
I can get it to work if I create a separate ~/Dropbox folder for each user, but this ends up with 50GB duplicated twice over if the entire Dropbox syncs - a particularly ridiculous waste of space on an SSD.
Any ideas how to make this sharing work????
You can do this using ACLs, which will avoid permissions problems when new files are created:
sudo chmod -R +a "$USER allow read,write,append,delete,list,search,add_subdirectory,delete_child,file_inherit,directory_inherit" "$DIR"
where $USER
is the username of the other user, and $DIR
is whatever directory (Dropbox or otherwise) you want the other user to have full permissions in.
We use this to share a single Dropbox folder between four users (2 adults with full access, 2 kids with access to their subdirectory only), and it has been working well for us. The only limitation is that the user running Dropbox has to be logged in and running Dropbox. The other users don't have the Dropbox icon and status info in the menu bar.
One method I've used with some success is to set the permissions on the folder to allow multiple user accounts to "Read & Write" to the /Users/Shared/Dropbox/
folder.
You can do this by:
- Going to the
Get Info
(Cmd+i) window on the/Users/Shared/Dropbox
folder - Unlocking to edit permissions
- Clicking on the "+" icon to add another user account and setting the "Privilege" to "Read & Write"
- Click on the gear triangle dropdown to the left of the lock icon, choose "Apply to enclosed items..." and confirm that you wish to do this (irreversible) change
I'm not very sure, but you may still have some permission related issues if you get files from another Mac's user account. That may require assigning ownership correctly.
While not a complete solution, you can choose which dropbox folders to sync on your second account, thus reducing the amount of HDD space required and unnecessary duplicate files.
You can also leave the Dropbox folder in the default location and symlink the ~/Dropbox into /Users/Shared/ and enable permissions with Terminal.app thusly:
user@mac: ~$ ln -s ~/Dropbox /Users/Shared/Dropbox
user@mac: ~$ chmod -R 777 ~/Dropbox
I wanted to use this same solution to work around a Dropbox for Business account with the "Allow only one Dropbox account per computer" restriction enabled.
The ACL solution is promising, but I encountered frequent permissions issues; it turns out ACLs are not inherited by existing files that are copied/moved into a directory, which is a deal breaker.
Here's the solution on which I eventually settled; this assumes all local administrator users will share access to the Dropbox.
Choose a user to run Dropbox. The Dropbox folder will reside in this user's Home folder, and the user must be logged in for the Dropbox to sync.
-
Change the
umask
for user applications to002
. This will make new files group-writable by default; this should not be dangerous, since your user's group is probablywheel
, and all members ofwheel
already havesudo
permissions.For OS X Yosemite 10.10.3 and up:
sudo launchctl config user umask 002
For older versions, see the Apple Support article Setting a custom umask in OS X.
Restart your computer for the
umask
change to take effect.-
Recursively modify the permissions of your shared Dropbox folder to give full permissions to both user and group:
cd $HOME sudo chmod -R ug=rwX Dropbox/
-
For each user, add the group write permission to all pre-existing user files:
cd $HOME sudo chmod -R g+w Desktop/ Documents/ Downloads/ Movies/ Music/ Pictures/ Public/ Sites/ sudo chmod g-w Desktop/ Documents/ Downloads/ Movies/ Music/ Pictures/ Public/ Sites/
The first
chmod
applies group write recursively; the secondchmod
removes group write from the directories themselves to keep them protected.
Everything should now work as intended. The second user can add the first user's Dropbox to the Finder sidebar, and Dropbox runs surprisingly well on the background user account. Only the Finder integration and menu bar status are missing.
Since each OS X user account can use this method to share its own Dropbox, this essentially provides for unlimited Dropbox accounts on a single machine.