How can I mount a SMB network share that can be accessed by anyone? Here's what I tried:
Using mount command
me$ sudo mkdir /Multimedia
me$ sudo chmod 777 /Multimedia
me$ sudo mount -t smbfs -o nosuid,-d=777 //user:password@qnap/Multimedia /Multimedia/
then
me$ cd /Multimedia
-bash: cd: /Multimedia: Permission denied
permission on /Multimedia after mounting
drwxrwxrwx 1 root wheel 16384 Nov 8 11:04 Multimedia
yet this works
root# cd /Multimedia
tl;dr only root can access mounted share
Using automount
in /etc/auto_master
#
# Automounter master map
#
+auto_master # Use directory service
/net -hosts -nobrowse,hidefromfinder,nosuid
/home auto_home -nobrowse,hidefromfinder
/Network/Servers -fstab
/- -static
### SMB shares
/- /etc/automounts/smb -nosuid,noowners
in /etc/automounts/smb
/Multimedia -fstype=smbfs,soft,noowners,noatime,nosuid ://user:password@qnap/Multimedia
then
me$ sudo automount -vc
automount: /net updated
automount: /home updated
automount: /Multimedia mounted
automount: no unmount
after that
me$ cd /Multimedia
me$ ls -ld /Multimedia/
drwx------ 1 me staff 16384 Nov 8 11:04 /Multimedia/
Works! But unfortunately other users have no access
otheruser$ cd /Multimedia
-bash: cd: /Multimedia: Permission denied
Yet if I
me$ umount /Multimedia
and then
otheruser$ cd /Multimedia
otheruser$ ls -ld /Multimedia
drwx------ 2 otheruser staff 1 Nov 8 15:17 /Multimedia
Works! But
me$ cd /Multimedia
-bash: cd: /Multimedia: Permission denied
and yet
root# cd /Multimedia
Works!
tl;dr only the user that caused automount and root have access to the share
noowners
ornosuid
flags I always got the current user as owner andstaff
as group on a mount point. (btw you've got a typonowness
in/etc/auto_master
)