473,569 Members | 2,836 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7365
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.col umbus.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*******@hotm ail.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
2844
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
16429
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 But I am having a problem figuring out the LDAP:// The LDAP:// that I pass looks like this (i substitued generic the
1
1802
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 our own user table that uses crypt() to store passwords. I'd like to remove our 'redundant' user table and use pg_shadow. The authentication function...
3
6963
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 much on it except the pages at starship.python.net. I don't need to do anything except authenticate and gain the correct credentials.
1
1286
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. Note that this app has been in production for three years with no problems. All .NET apps are authenticating fine from the same server. This same...
1
1248
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 a content page created from a masterpage.master. Styles are lost on all controls on all content pages not just the main content page. Thanks in...
3
11239
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
5602
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 $passwd in mysql_insert. The password gets encrypted and stored in mysql. Now I want to check if the user has entered the correct password when he logs...
0
1192
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 like this (i substitued generic the following with generic name):
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7922
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.