Re; [techtalk] Permissions

Fan, Laurel Laurel.Fan at compaq.com
Mon Jun 19 11:08:51 EST 2000


Lilly S., lilly at shellyeah.org, said:
> Does anyone have a reference that tells what files need to be what? For
> example, what permissions do CGI files need to be? How about the cgi-bin
> directory? And the html or public_html directory?

It depends what user your webserver is running as, so it might be in the
documentation of your webserver (or there might be people here running
your webserver that would know..).

The public_html directories should generally be readable (and not
writable) by anyone (and you don't really have any reason to make them
less accessible if they're going to be on the web anyway).  To make
a directory searchable, you actually must add the execute bit (x), so
  chmod a+xr public_html
(chmod anyone add execute and read permission to public_html) should work.
Also, all the directories above it in the tree (ie if your html dir
is /home/lilly/public_html, then /, /home, and /home/lilly are above it
in the tree) must be searchable (ie have x set).  This is usually the case,
but if you've been changing stuff, you might want to check that.
(use 'ls -ld <directory>'; the -d means "ls the directory, not the files
in the directory")
Files in that directory should be readable by all and not writable or
executable (unless you have user directory cgis, but that's another story)
The u and g permissions as determined by your umask are probably fine.

The cgi files you generally want to be readable and executable by the user
the webserver runs as (if you're running apache, I think the user and
group are in the config file, for roxen, it's somewhere in the config
interface.)








More information about the Techtalk mailing list