#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    58
    Rep Power
    14
    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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    Are you referring to /etc/passwd?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    58
    Rep Power
    14
    Might be.
    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.


  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    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.

    -- Christopher
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    58
    Rep Power
    14
    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.

    Jens
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    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:
    who

    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.

Similar Threads

  1. Can user A read user B's session?
    By Stupid Khor in forum PHP Development
    Replies: 9
    Last Post: May 11th, 2004, 05:19 AM
  2. database access using thread
    By padmini in forum Visual Basic Programming
    Replies: 3
    Last Post: February 6th, 2004, 12:38 AM
  3. malloc and adding record to binary database file
    By shardservant in forum C Programming
    Replies: 5
    Last Post: January 24th, 2004, 08:28 AM
  4. php user levels
    By dynasty in forum PHP Development
    Replies: 1
    Last Post: January 20th, 2004, 02:01 PM
  5. How to get multiple sessions for one user working?
    By jkoerber in forum PHP Development
    Replies: 1
    Last Post: January 16th, 2004, 01:23 PM

IMN logo majestic logo threadwatch logo seochat tools logo