permissions question

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Wed Dec 29 06:44:10 PST 2004


Duane Winner <dwinner-lists at att.net> writes:

> I don't know if I am having a brainfart, something is different, or if
> I never had it right to begin with:
> 
> I need to have a shared directory for apache web content:
> 
> /usr/local/htmlstuff
> 
> And a group, "htmlguys", and several users will be members of that group.
> 
> I would like to have the root directory set up like this:
> 
> drwxrwxr-x   2 me  htmlguys          512 Dec 27 15:06 htmlstuff
> 
> Where "htmlguys" is the owner.
> 
> Any member of htmlguys must be able to read, write and create any file
> or folder in htmlstuff, and the group owner of any file or folder in
> there must still be set to "htmlguys", so that one group member can
> edit another group member's file. They should be able to delete files
> and folders that they did not create as well.
> 
> When I ran apache on a Redhat box, I thought I just ran:
> 
> # chmod 2770 on htmlstuff
> 
> and that did the trick for me. Any time a member of htmlguys creates a
> new file in there it will be automatically be owned by the user who
> created it and the group "htmlguys".
> 
> But that doesn't seem to work on FreeBSD.
> 
> I always referred to that '2' before '770' as the 'sticky bit' for the
> group, but I was reading up on setuid, setguid and sticky bits this
> morning, and obviously, I had it all wrong. But I know that it "did"
> work on Redhat (I still have that server in production, and tested it,
> so I know that works).
> 
> So I'm quite confused now, and can't find any documents that describe
> how to do what I need.
> 
> Can anybody help me out with this?

According to "man chmod", the sticky bit is 1000(oct), not 2000.

Try setting it symbolically instead of numerically:
 # chmod +t htmlstuff

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
		http://be-well.ilk.org/~lowell/


More information about the freebsd-questions mailing list