How mount (cifs) in Ubuntu a MacOS directory with all permissions
On the MacOS Samba server, you'll need to ensure the connecting account has "Full Read/Write" permissions to the shared directory. From there, this connection string will work for a manual mount situation:
sudo mount -t cifs -o uid=omicron,username=omicron,password=superSecretPassword!123 //192.168.1.X/directorynameshared /mnt/192.168.1.X/directoryname
Note that the uid
and username
values are both the literal name of the account on the MacOS machine, and the password
value is also explicitly provided. I've not encountered a situation with a MacOS Samba host where the rw
or gid
flags are required when manually mounting a share.
If you plan on adding the mount to your /etc/fstab
file, there are a few extra things you'll need:
//192.168.1.X/directorynameshared /mnt/192.168.1.X/directoryname cifs uid=505,gid=507,username=omicron,password=superSecretPassword!123,file_mode=0770,dir_mode=0770,nounix 0 0
Note that when the share is mounted via /etc/fstab
, the uid
and gid
values are required, as well as flags for file_mode
and dir_mode
, plus nounix
. The nounix
flag is particularly important if your Ubuntu Server is going to be writing files via Apache and other service utilities.