Hi
I have the following problem: I want to grant different access rights
to different users on a page, identified by username/password. I want
to load the set of users/passwords from a database, from a file, or
whereever. This is more or less OK: outside users connecting via the
web can sent their username/password ($_POST variable), the script
checks it agains the users/passwords in the database, and grants
different access rights according to the username.
However, this is not safe against local users of the same machine:
since the php script of every local user runs under the same uid/gid,
every user can access the same database using a php script. One could
argue, that they can not figure out, how to access this database
(where it is located, if it requires a password, etc). But since my
php script must be readable by the www server (user=wwwrun), they can
read this script from a php script, which runs under the same uid.
I have found some articles about setting up different vhosts in
apache, and running these vhosts with different UID. But this needs
apache-configuration, as root. Is there a per-user way, which any user
can follow without the intervention of root, to set up a database,
which is only accessible by his php scripts?
Thank you
Daniel
I have the following problem: I want to grant different access rights
to different users on a page, identified by username/password. I want
to load the set of users/passwords from a database, from a file, or
whereever. This is more or less OK: outside users connecting via the
web can sent their username/password ($_POST variable), the script
checks it agains the users/passwords in the database, and grants
different access rights according to the username.
However, this is not safe against local users of the same machine:
since the php script of every local user runs under the same uid/gid,
every user can access the same database using a php script. One could
argue, that they can not figure out, how to access this database
(where it is located, if it requires a password, etc). But since my
php script must be readable by the www server (user=wwwrun), they can
read this script from a php script, which runs under the same uid.
I have found some articles about setting up different vhosts in
apache, and running these vhosts with different UID. But this needs
apache-configuration, as root. Is there a per-user way, which any user
can follow without the intervention of root, to set up a database,
which is only accessible by his php scripts?
Thank you
Daniel
Comment