Is it possible to give read&write permission without delete permission?

Loïc Grenié loic.grenie at gmail.com
Wed Dec 16 17:05:52 UTC 2009


2009/12/16 bulut dinibutun <bulut19 at hotmail.com>:
> Hello everyone.
> I was wondering if there's any possible way to give read&write permission in
> a spesific directory without delete permission.
> Let's Say i have a directory named "stored" in home directory and i've set
> up a program so as to save snapped images automatically in that folder by
> the user who snaps the image and i only want root to delete any of these
> images regardless of whoever created it. Is this possible?If so how?

    You have to set the "sticky" bit of the directory:

chmod 1777 ~/stored

  That way only the owner of the directory and root can delete the files inside.
  Each and every other user can create new files (because they have write
  permission to the directory). Each file is modificable according to its own
  mode (the fact that a file is "read-only" or "read-write" depends on its own
  permissions, not on the directory).

      Loïc




More information about the ubuntu-users mailing list