I've got a Synology NAS and a Mac mini running Plex and XBMC, which streams content from the NAS. The MM frequently loses the connection to the NAS, for several reasons (e.g. after updating/rebooting the NAS, network problems, OS X problems).
After trying several solutions for this issue, I finally came across the built-in automount tool, which is supposed to reconnect network drives when the connection is lost. I set it up, and it seemed to work. But there's one annoying problem:
I'm not sure how to phrase this, but automounted shares seem to enter some kind of not-really-connected state from time to time. When the share is traversed, it immediately connects. That's fine, but the share is mounted only for the user who accessed it.
I've got two user accounts: TV, which runs Plex and XBMC and needs to access the share, and Admin, which I use for management tasks. Occasionally, I use the Admin account to connect to the NAS as well, but I'm using the Finder for that. There's no need for a permanent connection.
For some reason I don't understand, sometimes, the automounted share is mounted for the Admin account. Which means the TV account is unable to access the share (Permission denied). I can umount
the share with Admin and ls
it with TV to mount it for the latter, but after some time, Admin has the permissions again.
How can I fix this? How do I have to set up the permissions so that TV is the only account who can access the automounted share?
Here's what my automount files look like:
auto_master
Permissions: -rw-r--r-- 1 root wheel
+auto_master # Use directory service
/net -hosts -nobrowse,hidefromfinder,nosuid
/home auto_home -nobrowse,hidefromfinder
/Network/Servers -fstab
/- -static
/- auto_nas -nosuid,noowners
auto_nas
Permissions: -rw------- 1 root staff
/NAS -fstype=smbfs,soft smb://TV:@192.168.1.56/Files
/NAS (the mount point)
Permissions: drwx------@ 1 TV wheel
The MM is running Yosemite (10.10.3).
Best Answer
Assuming you do NOT want to enable the "root" user login feature and loosen up file and directory permissions enough to potentially open up your system to a significant security attack vector (and I am assuming exactly that...), as of today, Feb 7, 2017, there is no way to accomplish what you describe :(
At least not for AFP / SMB / CIFS shares (those are the only three I have tested, you may have other luck with NFS volumes but I don't run those on my network so can't confirm).
There appears to be two potential root causes. One is that sometime around Yosemite, there was some modification to the difference between using direct vs. indirect automounting functionality that caused intermittent failures when an auto mounted share was accessed by more than one user.
As of Sierra, this functionality is completely broken since the owner of the special /Volumes directory was made to be the "root" user and that user will take over ownership automatically if another user is granted ownership of any folders or files in that directory at some point. Bugs have been filed, feel free to comment and share your outrage.
In the comment section over on this blog post discussing several examples of using automount (and a few of its limitations) user "Mark" provides a complete analysis of this issue with respect to sharing auto mounted folders across multiple users.
TL;DR - it was broken somewhere around 10.10 and despite being discussed across many forums Apple has not yet acknowledged the bug or committed to a fix.
User "Ben" commented, confirming this analysis and echoing that at least as of the time he shared his comment, there was no fix:
NOTE : I do not recommend this for any network so will not provide detailed instructions on how to do so here, but one other user on that same comment board indicated that enabling the root user login and using that to access his system would allow this to work as expected:
This is strongly discouraged by everyone, Apple, Security Experts, etc so I do think it is a viable path around this problem. We will have to wait until Apple releases a fix.