How to allow Windows pc to modify Linux files over Samba server without allowing full 777 access?
I see what you want. All users/computers on your LAN should be 'guests' and have full 'read/write' access to the file share.
Steps:
Check Samba config. Does the share include these:
[Share]
available = yes
browsable = yes
public = yes
writeable = yes
Check POSIX permissions. Example ls -lh:
drwxrws---+ 1 nobody nogroup 252 May 12 14:55 Music
You will want to have the sticky bit there otherwise the fileshare won't behave like you would expect in windows. chmod 2770 [dir]... To apply with permission to all the directories use find. Example
find . -type d -exec chmod 2770 {} \;
find . -type f -exec chmod 2760 {} \;
You will also want to set the group to be nogroup, which is the default guest group for samba.
Finally acls. Use getfacl and setfacl. You'll want to setup defaults for the user nobody and the group nogroup. Once you've done that, anything that gets created via samba will inherit good permissions. Here's an example directory ACL:
# file: Downloads
# owner: nobody
# group: nogroup
# flags: -s-
user::rwx
group::rwx
mask::rwx
other::---
default:user::rwx
default:group::rwx
default:mask::rwx
default:other::---
To get some defaults going, use find:
find . -type d -exec setfacl -d -m u::rwx {} \;
find . -type d -exec setfacl -d -m g::rwx {} \;
To fix up existing files:
find . -type f -exec chgrp nogroup {} \;
find . -type f -exec chmod 660 {} \;
find . -type f -exec setfacl -m g::rw {} \;
WANT MORE !
Let's just say that you don't want to change the POSIX group. Then you can use the ACL to explicitly add the group. Example:
setfacl -m g:linuxgroup:rw [filename]
With these settings I share between ubuntu, windows, RPi, android, and other linux apps.