[olug] share a folder rw, but not deletable?

Thom Harrison id4spam at cox.net
Wed Mar 26 23:48:16 UTC 2003


The only possible problem is that the users can't delete any other files in
aaa either.  Apparently that's not a problem in Brian's case though.

Another way to make the directory non-deletable by non-root users is set the
directory "t" permission and create a file within the directory that is
owned by root.
If the directory has 777 permissions  ( rwxrwxrwx ) then chmod 1777 bbb will
change it to rwxrwxrwt. ( or chmod o+t bbb if you prefer )  This only allows
a user to delete files that they own. Since all of the files within the
directory have to be removed to delete the directory, the directory itself
cannot be deleted.

The drawback is, of course, that a user has to own any files that they want
to delete.  ( drawback? guess it depends on the situation ).

*** The "t" bit has a completely different meaning when applied to a file as
opposed to a directory,  I believe it means that the file remains in memory
after being executed.

The best method of course, is the one that works for a given situation.

Thom

----- Original Message -----
From: "Jay Hannah" <jay at jays.net>
To: "Omaha Linux User Group" <olug at olug.org>
Sent: Wednesday, March 26, 2003 7:23 AM
Subject: Re: [olug] share a folder rw, but not deletable?


>
> Brian Wiese wrote:
> > Is there a way in UNIX to make a folder with read+write permissions for
> > some group of users, but only allow them to read and write to the
> > folder... not actually delete the folder itself?
>
> folder -> directory
>
> A user can delete a directory only if they have write permissions to the
> directory above the directory in question.
>
> If your group of users is called "users":
>
> mkdir aaa
> mkdir aaa/bbb
> chgrp users aaa/bbb
> chmod g+w aaa/bbb
>
> Now any member of the group "users" can write files in aaa/bbb, but they
> can't delete the directory aaa/bbb because they don't have write
> permissions to aaa.
>
> Doea that make sense? I thought the example might help...?
>
> Cheers,
>
> Jay Hannah
> Omaha Perl Mongers: http://omaha.pm.org
>



More information about the OLUG mailing list