RE: [PHP] -----s--- bit
| From: | Opec Kemp \( Ozemail \) | Date: | Fri, 23 Feb 2001 02:59:33 +0000 |
| Subject: | RE: [PHP] -----s--- bit | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41251@lists.php.net to get a copy of this message | ||
Hi,
Why do you want to access /etc/shadow from your PHP?. As a general
rules of thumb that's a pretty bad idea. The reason for this is that
/etc/shadow is owned by Root and it's *should* only be readable by
Root
and noone else.
Now in answer to your question "Why your PHP" script can't read
/etc/shadow is that if you're PHP script is running as Apache module
(or even a stand alone CGI). Your User ID would most likely *not* be
Root.
Thus you are not allowed to read the /etc/shadow.
You are able to fix this by running the Apache process as Root!
THIS IS A VERY VERY bad idea but possible nonetheless as it is
a huge security hazard.
To configure Apache to run as Root, check out Apache doc
HTH.
> Hi,
>
> I am running apache server as user/group=apache/httpd
> And want to access the shadow file to authenticate my users
> from the system.
>
> shadow file is owned by root and chmod to 400.
>
> server-root:/5:28pm>ls -al /etc/shadow
> -r-------- 1 root sys 27695 Feb 22 10:06 /etc/shadow
>
> I can access the shadow from cgi-bin / c code by giving the
> chmod +s bit .