hi to all, im new here and to linux, i have managed to setup sumba (more or less) with couple read-only folders and printer (all works fine) but (there is allways a but) i cant setup one writable folder, the problem is in permissions, when i upload a file (or creat a dir) from winBLOWS owner and group is set to “nobody” which prevents linux user (other than root) to read, mod, del etc… uploaded files or folders unless i change ownership with chown is there a way to do this automaticly whenever a file or folder is uploaded. and one more thing since owner is “nobody” and all win machines are nobodys how can i prevent deleting files from folder i have tryed (from yast) to set mask for folder but it seams like they dont work
yast config for auzdesk_downloads (shared folder with upload)
guest ok - yes (this has to stay since i want anybody to create or read files)
create mask 0600
directory mask 0700
read only - no
tnx in advance
Hello auz0bgd, welcome to the forums
Looks like the share definition in smb.conf is something like this:
[auzdesk_downloads]
path = path_to/auzdesk_downloads
guest ok - yes
create mask 0600
directory mask 0700
read only - no
If the owner of the folder is, for example, billy_wilder
Add billy_wilder to the Samba user database with the command:
sudo smbpasswd -a billy_wilder
Then make billy_wilder the owner of the folder auzdesk_downloads (and all it’s contents just to get things right from the get go).
And add thois line into the Samba definition for [auzdesk_downloads]
force user = billy_wilder
That should fix it. I guessed a few things about the share here, but I hope you follow my drift.
PS I see no need for the lines like this:
create mask 0600
directory mask 0700
Unless you really wanted to style the share that way. (just a comment).
tnx it worked, tho sucky windows nobody users can still delete content from folder is there a way to prevent that
tnx
Do you want a few users to be read/write but most users to be read-only
OR
Do you want the opposite; i.e. do you want a few users to read-only but most users to be read/write
Which?
ww got some communication probs, prolly my bad didnt explain what in need in detail so:
on my lan there are several windows xp machines i need to setup smb share on my linux so any1 can read content from shared folders and use printer (with no logins - anonymous) - no problems with this
also i need 1 folder where everybody can upload files (also anonymous) but also they CANT delete or modify existing content shared in that folder
note all windows users are represented by linux as “nobody” so u can consider it as a single user who can do previously explained sutff
tnx swerdna
Continuing with our example:
[auzdesk_downloads]
path = path_to/auzdesk_downloads
guest ok = yes
create mask = 444
read only = no
This will allow to put files there and then to read them or to copy them back to the network user’s computer, but not to delete them.
444 makes permissions -r–r–r–
No problem. It also occurs to me that user “nobody” is difficult to administer for an administrator logged onto the server. You can make that a bit tidier buy making all files uploaded to the server to be owned by a normal user. Suppose there was a normal user “fred” on the server. You could make the shared folder to be owned by fred and you could add this line:
force user = fred
and all the files will be owned by user=fred, group=users – it’s tidier – while that might be nice if you’re a towel straightener, it’s not necessary for the welfare of the country.