473,385 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

authenticating against /etc/passwd

Hello,
I've got a php script that is trying to authenticate a user against a
rh9 /etc/passwd file. The passwd file has permissions of 444 but when i try
to log in i am being redirected to my error page with the error invalid
username or password. I have confirmed that the user in question can
manually log in to the system so i know the credentials are correct. My only
idea has been that the password uses special symbols a dollar sign for one
and i thought escaping them with '' would work, this has not. Suggestions
welcome.
Thanks.
Dave.
Jul 17 '05 #1
5 7351
dave <dm*******@woh.rr.com> wrote:
I've got a php script that is trying to authenticate a user against a
rh9 /etc/passwd file.


??? It's been quite some years since all Linux distributions switched
to shadow passwords. Useless you messed around /etc/passwd shouldn't
contain passwords, eg:
root:x:0:0:root:/root:/bin/sash
--

Daniel Tryba

Jul 17 '05 #2
> rh9 /etc/passwd file. The passwd file has permissions of 444 but when i try

As mentioned above, your passwords will not be in the /etc/passwd file.
They are in the shadow file.

You should look into PAM authentication

____________________________________
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Business | Personal
Jul 17 '05 #3
Try generating the MD5 hash value of the password and comparing that
to the value stored in the passwd file..as far as i know linux
generates MD5 hashes and stores them instead of the real password...
that is why passwords in linux are irrecoverable... u can use the Md5
function in PHP to do that..

bye
Arvind

"dave" <dm*******@woh.rr.com> wrote in message news:<CD**************@fe1.columbus.rr.com>...
Hello,
I've got a php script that is trying to authenticate a user against a
rh9 /etc/passwd file. The passwd file has permissions of 444 but when i try
to log in i am being redirected to my error page with the error invalid
username or password. I have confirmed that the user in question can
manually log in to the system so i know the credentials are correct. My only
idea has been that the password uses special symbols a dollar sign for one
and i thought escaping them with '' would work, this has not. Suggestions
welcome.
Thanks.
Dave.

Jul 17 '05 #4
With total disregard for any kind of safety measures
<la*******@hotmail.com> leapt forth and uttered:

Please do not post in HTML format in future.

--
There is no signature.....
Jul 17 '05 #5
With total disregard for any kind of safety measures
as****@uncc.edu (Mad Max) leapt forth and uttered:
Try generating the MD5 hash value of the password and comparing
that to the value stored in the passwd file..as far as i know
linux generates MD5 hashes and stores them instead of the real
password... that is why passwords in linux are irrecoverable...
u can use the Md5 function in PHP to do that..


Actually I believe the passwords in passwd are encrypted using
crypt(), not md5()

Heres something the O.P. may wish to look into:
http://pear.php.net/package/File_Passwd

--
There is no signature.....
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Smitro | last post by:
Hi, I'm looking for a Tutorial about Authenticating using PHP and Linux User Accounts. Can some one point me in the right direction? Smitro
3
by: mrwoopey | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and Visual Basic .NET": http://support.microsoft.com/default.aspx?scid=KB;EN-US;326340 ...
1
by: William Harazim | last post by:
Is there a way, having a user entered username and password, to select a single row from pg_shadow which is using md5 password encryption? I'm currently authenticating web users (.asp page) with...
3
by: David | last post by:
Hi, I've had a quick look but cannot find a module that will let me authenticate against Kerberos. There appears to be a krb5 module that hasn't been updated for a long time and I can't find...
1
by: mirlisa | last post by:
We have an odd problem. Sometime this morning our classic asp web application stopped authenticating against active directory. This is our only "classic" asp app that authenticates against ad....
1
by: spelunka | last post by:
Hello, does anyone know why one would lose their styles after successfully authenticating against forms auth? I'm using asp.net 2.0 and the page that is being redirected to after authenticating is...
3
by: Rocky Zhou | last post by:
Today I found a problem, when I wrote a section of PHP code like this: <?php $fp = fopen("/etc/passwd","r"); if($fp) { echo 'ok!'; $result = fread($fp, 8192); return $result;
8
by: sathyashrayan | last post by:
Dear group, For a log-in page I have created a mysql db and user registers with a user name and password. The password field is encrypted with $passwd = sha1($_REQUEST); I insert the...
0
by: Nandagopal | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and C#": But I am having a problem figuring out the LDAP:// The LDAP:// that I pass looks...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.