[WEB4LIB] Re: LINUX on a public workstation reprise
Richard L. Goerwitz III
richard at goerwitz.com
Tue Jun 19 10:44:42 EDT 2001
Kay McCoy wrote:
> > You should be able to have a single file in the directory be open to write
> > globally, while the directory itself is only writable by root.
> >
> My co-worker says "it doesn't work" - if you can't write to a directory as
> user, you can't write to a file in that directory as user.
That's not strictly correct. I don't know how relevant this is to the
list as a whole, but I suspect if you're running into confusion here,
others will, too. So a posting to the list seems warranted.
In order to write to a file in a directory, you don't have to have
write permissions on the directory itself, just the file. You also
need permission to 'cd' into the directory (for techies, that's bit
1; in octal, then, you'll need the directory to have at least 0711
permissions; 0755 or 0775 is more appropriate, though, probably).
Here's one strategy; please make sure you understand what these com-
mands all do, and tailor them to your setup:
1) cd ~user (cd to the home directory of user)
2) chown -R root.root . (make root own everything in that directory)
3) find . -type d -exec chmod 2775 {} \; -print
4) chgrp user file-you-want-user-to-write-to
5) chmod g+w file-you-want-user-to-write-to
--
Richard Goerwitz richard at Goerwitz.COM
tel: 401 438 8978
More information about the Web4lib
mailing list