Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Samba and file permissions

Status
Not open for further replies.

HughShane

Technical User
Feb 27, 2008
12
GB
Suse 9, Samba 3 and a dozen WinXP Pro users. Users saving M$ Word documents to a common area (/common/docs/) find that other users' documents are read-only. I've played around with force create mode and force directory mode (both currently set to 0775) in smb.conf until I'm blue in the face but I cannot get to the situation where a document saved by one user can be edited and saved by another. All users are in one group called 'feet'. Tearing my hair out over this 'simple' little thing! Can anyone point me in the right direction please?
 
QatQat misses the point.

The problem occurs when users DON'T use samba. The script just fixes the problem that will occur later when users use other access means like scp, ftp, rsync, nfs etc. as I said in my first posting. And it doesn't hurt.

eugene
 
Hi elgrandeperro,

the problem does not exist
"Suse 9, Samba 3 and a dozen WinXP Pro users", this is HughShane's setup so I assume that only samba users will access the Suse Server.

Yes there is the eventality of a smarter windoz user using pscp, sftp and so on, but that is not what seems to happen in this case.

QatQat

If I could have sex each time I reboot my server, I would definitely prefer Windoz over Linux!
 
elgrandeperro and QatQat, there is absolutely no chance of any of the ladies at their terminals doing anything other than Windows things in Word. They even think that turning off the screen turns off the computer!

Having run the setfacl command as shown above by Annihilannic, I asked them to do a simple Word save and retrieve test today with different users but they've been too busy. Hopefully tomorrow. I'll get back to you with the result.

Thanks again for all your ongoing help and suggestions; we'll get there in the end I'm sure. I just wonder why this seems so complicated!
 
HughShane:

If you've set the group bit, you can create a file through samba as your user, and if you do a `ls -lh` and look for your new file, you'll see right away if it was created under the right group.

Hopefully your problem is solved.
 
Yes, danomac, there's only one group. What the problem is concerned with is that a Word file created and saved by one user in the group, cannot afterwards be edited by another user in the same group. The file always comes up as Read-only.
 
Right, it works! It seems that the setfacl command finally did the trick. Thank you all very much for helping me through this.

One final thing. So that that this will survive a server reboot, where should I place this command:

setfacl -m "default:u::rwx,default:g::rwx,default:eek::r-x,default:m:rwx" /user/Common/DOCS

and would I also need to include:

chgrp -R feet /user/Common/DOCS
find /user/Common/DOCS -type f -print0 | xargs -0 chmod 664
find /user/Common/DOCS -type d -print0 | xargs -0 chmod g+s 775
 

I believe the setfacl should always inherit from above, so you don't need to continually do anything (unless someone monkeys around with it using non-Samba). You can test by creating a folder, copying a file, and looking at the permissions.

Just keed the store the commands in a script for later usage.
 
Thank you, elgrandeperro, I'll keep the commands and try the folder creation you suggest. Very many thanks to you all for all your very kind assistance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top