[Solved] SAMBA permissions issue

Morning all, I have created a SAMBA share running off a USB 3 HD connected to my Linksys WRT1900ACS running 17.01.04. I want this to be a simple, no security share that anyone can create, delete or otherwise use for files. Problem is, I keep running into an issue with premissions in directories.

The Share is set up with the /etc/config/samba as follows:

config sambashare
        option name 'Media'
        option path '/mnt/share'
        option read_only 'no'
        option guest_ok 'yes'
        option create_mask '0777'
        option dir_mask '0777'

That should, I think create the free-for-all that i am after.

However, when I create a folder from a remote machine (in this case, running Ubuntu, the permissions turn out thus:

drwxrwxr-x 2 systemd-timesync nogroup 0 Jan 11 11:56 test2

In other words, I can't create any files or folders within that folder.

What am I doing wrong here?

If it helps, the ubuntu mount is as follows:

//192.168.1.1/Media /media/Media cifs rw,_netdev,user=guest,password=,uid=100,iocharset=utf8 0 0

Any thoughts?

Strange, i doubt this will make any difference, but you might try changing your perms to just 777, meaning drop the 0, and see if that works.

edit - You might also try connecting the usb drive directly to your Ubuntu machine and setting your preferred perms from there.

I think your problem is in the user / group that owns the files / folders that SAMBA creates: your "test2" folder should not be owned by "systemd-timesync - nogroup". And I guess that is because your clients are using their UID / GUID when they create the files.

You can try to use parameters "uid", "gid", "forceuid", "forcegid", and "setuids" on the client (have a look at the man page for "mount.cifs"). Or you can instruct the server to force a user / group for all files created (but that requires moving the shares configuration to "/etc/samba/smb.conf.template".

I think it was a combination of both of these that fixed it. I went into the router and did a chmod -R 777 * on the shared directory, then read over the ubuntu docs again and updated the fstab line to this:

//192.168.1.1/Media /media/Media cifs rw,_netdev,vers=2.0,file_mode=0777,dir_mode=0777,user=guest,password=,uid=1000,iocharset=utf8,    0       0

That seems to work, so I think it was a permission issue at both ends, plus the need to specify a version of SMB and set a file mask. What a pain!