[Samba] modify only, not deletable

Tim Wunder tim at thewunders.org
Tue Feb 13 12:59:14 GMT 2007

On Tuesday 13 February 2007 4:49:32 am Joshua, C.S. Chen wrote:
> Rashid N. Achilov wrote:
> > On Tuesday 13 February 2007 14:30, Joshua, C.S. Chen wrote:
> >> Hi folks,
> >> I have a samba file server joining a Windows 2k AD as member server.
> >> I wonder how I can setup the files on the samba share to be modifiable
> >> by users, but no one can delete them. Is it possible? linux chattr
> >> command doesn't seems to help, and I can only setup windows share
> >> permission (full control, read,write) for the samba files from windows
> >> interface, not NTFS detailed permissions. Any idea?
> >
> > When you are under FreeBSD, it has chflags command to set "undeletable"
> > flag. I think, trying to delete flagged file should lead to "access
> > denied" message.
> Thanks for the info.
> now samba is running on a linux CentOS 4.4, is it possible to do the
> same thing?

Perhaps through the use of the sticky bit on the directory...
from 'man chmod':
       When the sticky bit is set on a directory, files in that directory may 
be unlinked or  renamed  only by root or their owner.  Without the sticky 
bit, anyone able to write to the directory can delete or rename files.  The 
sticky bit is commonly found on  directories,  such  as  /tmp,  that  are  

Look at using something like 
        create mask = 0664
        force directory mode = 01775
in your smb.conf file.


Fedora Core release 6 (Zod), Linux 2.6.19-1.2895.fc6
 14:15:58 up 4 days, 20:04,  0 users,  load average: 0.15, 0.10, 0.09
MP3/OGG archive Total playlength : 14 days, 21 hours, 52 mins 42 seconds
"It's what you learn after you know it all that counts" John Wooden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba/attachments/20070213/1d7c92f4/attachment.bin

More information about the samba mailing list