I have been trying to achieve smb drive automounting on OS Sierra but I am unable to do it properly.
I hacked /etc/fstab which seems to work on this OS to the point that I am unable to force it to change ownership or chmod so other users than root can access it.
I seems that automount is ignoring all my attempts to set uid or gid for the mount and its always mounted as root:wheel.
I went through several threads that deal with that and found no solution anywhere so I tried using Automator with Applescript, where I used a command to Finder app that mounted drive for me, but it always asks for credentials so it's no use for me either.
Can anyone please provide working solution that mounts smb drive on OSx that's accessible for other users than root and works in headless mode (so it does not require any user to log in?)
Thanks
This works for me on macOS High Sierra:
That mounts the SMB share and shows it in the desktop
Otherwise I could use the auto_master. I added this entry in /etc/auto_master (you need root access):
And then I created /etc/auto_smb:
admin is the user allowed to read/write in my NAS and "password" is the password.
Also please note that the "soft" option is quite important. In case the resource is not available (network down or else) without it something in the OS may get stuck trying to connect to the resource.
Assuming that one is dealing with either OSX Sierra or High Sierra (10.12 or 10.13), the automount problems created by Apple's locking of /Volumes are many..
Here is a work-around (created by Apple folks) which essentially 'duct-tapes' a way thru it. https://support.apple.com/en-us/HT207112
TLDR version:
1. you must be 10.12.2 or higher (we recommend 10.12.6 as the only usable version of this pile of horse 'stuff').
2 run this in terminal: sudo defaults write /Library/Preferences/com.apple.NetworkAuthorization AllowUnknownServers -bool YES
NOW: the auto-connection option (>Sys Prefs>Users>Login Elements) will interact properly with keychain and will save your login info properly.