Re: Unix passwd file

From: Date: Fri, 04 Oct 2002 11:54:39 +0000
Subject: Re: Unix passwd file
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-118851@lists.php.net to get a copy of this message
Peter, I think he's stuck with the parsing part? you can file() the /etc/passwd file then explode() it and add the username,passhash parts and/or more values into the mysql table. Elias, "Peter Janett" <phplist@newmediaone.com> wrote in message news:026a01c26b94$7b45d0a0$55285742@peters... > You can just put the username and password in the MySQL database as normal > text, then build your applications that are reading them to check the > passwords with the UNIX Crypt function. > > In other words, just as your passwords are stored in a plain text file, > store them in plain text in the db. Then to confirm them, take the first 2 > characters of the crypted password, use them as the salt to crypt the > password the user entered, and compare the results. If that are the same, > they entered a valid password. > > I guess I'm assuming your existing passwords are in crypt format, but the > same process is probably possible with whatever format they are in. > > HTH, > > Peter Janett > > New Media One Web Services > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > New Upgrades Are Now Live!!! > Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 > Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, > Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > PostgreSQL coming soon! > > http://www.newmediaone.net > webmaster@newmediaone.net > (303)828-9882 > > ----- Original Message ----- > From: "Scott" <scott@scottah.com> > To: <php-general@lists.php.net> > Sent: Friday, October 04, 2002 4:43 AM > Subject: [PHP] Unix passwd file > > > > I apologize if this is might be OT. I have 5,000+ users in a unix passwd > > file that I would like to move to a MySQL table to build a login system > > with php. I could then use this table for Postfix and Radius. I know > > about the getpwent in perl, but does anyone know if I populate a MySQL > > table with the login/password can php then use that encrypted password to > > validate users? > > > > TIA > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

« previous php.general (#118851) next »