I’m having trouble setting up a Samba file share on my home server. Security is not a big concern. Here are the 3 things I need to accomplish:
- Fix permissions on the existing drive. Right now they are a mess. The shared folder is on a separate internal hard drive and is mounted as /mnt/Shared using the GNOME Disk Utility. The goal is to change permissions of folders to 775 and files to 664. I’ve tried the commands
find /mnt/Shared/ -type d -exec chmod 775 {} \;
find /mnt/Shared/ -type f -exec chmod 664 {} \;
which both ran for a while but didn’t seem to actually change anything. Is there a better way to get the permissions straightened out?
-
Set it so that the Samba user writes with 775 and 664 permissions. I have successfully forced user ‘smbuser’ and group ‘sambashare’ from Windows machines accessing the shared folder. I have the following in the smb.conf file
[Shared Folder]
path = /mnt/Shared
writeable = yes
browseable = yes
public = yes
create mask = 0664
directory mask = 0775
force user = smbuser
force group = sambashare
hide unreadable = yes
When a Windows user connects and adds a folder and file, the user and group are correct, but the permissions show up as ‘drwxrwxr-x’ (775) for folders which is right, but ‘-rw-rwxr–’ (674) for files, which is not what I call out in smb.conf.
- From the main administrator account I can delete files created by Windows users, but not folders created by Windows users even though the admin is listed as belonging to the group ‘sambashare’. I’m not sure what is going on with permissions here. I would also like to ensure the the admin always writes to the shared folder under the ‘sambashare’ group so that way all files and folders can be accessed and changed from any user. I tried looking into the setgid flag, but didn’t see much on how to use it.
Any help appreciated!