September 19th, 2000, 11:00 AM
Is it possible to connect to a linux user database via php?
Is the userdatabase really a database or just a file of some kind?
Thanks in advance
September 19th, 2000, 02:55 PM
Are you referring to /etc/passwd?
September 21st, 2000, 08:12 AM
I create a user on a Red Hat 6.1.
The users id, password, name etc. must be stored somewhere. Can I get that list, database or whatever that is. I need to use it in a php application.
Thanks for your answer's and a great book.
September 21st, 2000, 09:30 AM
That information is (usually) stored in the file /etc/passwd. Be very careful security-wise. /etc/passwd is pretty much the crown jewels of the system. If a flaw in your application somehow exposes this file to a cracker, that cracker can easily gain root access to your machine.
Are you sure you can't achieve what you want with the "who" command?
By the way, if you're running NIS or Yellow Pages then the user information will be stored in other places.
September 21st, 2000, 09:55 AM
I get your point and i don't wanna have hackers on my site.
I tried the 'hw_who' function without luck. Is there an example somewhere.
Thanks in advanced.
September 21st, 2000, 10:15 AM
Oh, sorry. "who" is not a PHP command, it's a Linux (shell) command. hw_who() is a PHP hyperwave function.
In a Linux term window, type:
and you'll see what I mean. Also type "info who" and "man who" for more information.
"who" will only show you currently logged-in users, though, not all user accounts.