Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Nov 2003 23:00:08 -0600
From:      "Kevin D. Kinsey, DaleCo, S.P." <kdk@daleco.biz>
To:        How Can ThisBe <howcanthisbe300@hotmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: File permission question
Message-ID:  <3FB5B2D8.6020503@daleco.biz>
In-Reply-To: <BAY7-F104XR5lK06Ye200009a15@hotmail.com>
References:  <BAY7-F104XR5lK06Ye200009a15@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
How Can ThisBe wrote:

> Hi, I've just noticed a small issue, which I'm sure others are aware of.
>
> For apache to server users webpages, apache need to be able to read files
> and directories. So we have something like the following (by default) on
> FreeBSD;
>
> tigger@piglet:~% ls -Al ./ public_html/index.php | grep pub
> -rw-r--r--  1 tigger  tigger  16 Mar 24  2002 public_html/index.php
> drwxr-xr-x  12 tigger  tigger       512 Aug 14 02:04 public_html/
>
> However, the following set-up is a little more secure (users can not read
> other users includes files for a start) and works fine;
>
> tigger@piglet:~% ls -Al ./ public_html/index.php | grep pub
> -rw-r-----  1 tigger  www     16 Mar 24  2002 public_html/index.php
> drwxr-x---  12 tigger  www          512 Aug 14 02:04 public_html/
>
> My question is, when I make a new file or directory in ~/public_html 
> (with
> chown tigger:www), the file is made with the following permission:
>
> -rw-r--r--  1 tigger  www      0 Nov 15 13:42 public_html/test1.php
>
> How can I make new files without the world readable flag set, within the
> public_html directory?
>

Change your umask.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3FB5B2D8.6020503>