PHP Authentication against /etc/shadow
I am fairly new with Linux (using RedHat 9 currently) and very new to php.
I hope I have this is the right area...
I am trying to do the following (in PHP)...
1. User submits a form that has their Username and Password
2. Page encrypts the password to check the username and password against the /etc/shadow file.
3. Page then allows the user to see his or her Disk Quotas and account details.
I have tried the following, but am getting an error "WARNING: fopen("/etc/shadow", "r") - Permission denied
(BTW all I am trying to do right now is see if the username is in the file)
the code is as follows:
$fd = fopen("/etc/shadow", "r") or die('File not availalbe');
$line = fgets($fd, 4096);
if ($line === $username)
echo "Match Found";
echo "No Match";
Any help would be greatly appreciated. I would like to do this without changing file permissions if I can.