Results 1 to 3 of 3

Thread: Listing users

  1. #1
    Senior Member
    Join Date
    Sep 2001
    Posts
    1,027

    Listing users

    (Maybe I'm just blind but...)

    Is there a way to list -all- users on a *nix box (BSD in particular) besides listing the passwd file?
    (BTW, I don't mean users logged in as with who or w...)

    TIA

    Ammo

  2. #2
    AntiOnline Senior Member souleman's Avatar
    Join Date
    Oct 2001
    Location
    Flint, MI
    Posts
    2,883
    you mean all the possible logins? The only way is through the passwd file. Or the shadow file....

    Most users also have there own directory in the /home/ directory, but that won't give you all possible logins, but it will give you most of the users that actually do login.
    \"Ignorance is bliss....
    but only for your enemy\"
    -- souleman

  3. #3
    PHP/PostgreSQL guy
    Join Date
    Dec 2001
    Posts
    1,164
    1: cat /etc/passwd | awk -F: '{ if ($3 >= 100) { print $1 } }' ... this shows you all users that aren't system accounts (system generally is below 25 for the UID).

    2: If you run a database, check your database for users. Users in a db don't have to have a login, especially if they can connect through JDBC or ODBC-oriented applications (I think that's right).

    A common mistake to 'lock out' a user was to do something like this:

    Code:
    #!/bin/sh
    
    echo "You've been locked out. Deal."


    Make this executable and put it as the user's shell. Problem is, it only works with telnet. FTP (back in the day) wouldn't check the shell. Now, ftp daemons check the shell of the user and sometimes, if it's not registered in /etc/shells or something similar, it won't let you in.
    We the willing, led by the unknowing, have been doing the impossible for the ungrateful. We have done so much with so little for so long that we are now qualified to do just about anything with almost nothing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •