verify a user

Discussion in 'Python' started by David Bear, Jan 19, 2006.

  1. David Bear

    David Bear Guest

    If I have a unix user name, is there a way to verify that the user really
    exists and query default group memberships?

    --
    David Bear
    -- let me buy your intellectual property, I want to own your thoughts --
    David Bear, Jan 19, 2006
    #1
    1. Advertising

  2. David Bear

    Dan Sommers Guest

    On Wed, 18 Jan 2006 18:25:19 -0700,
    David Bear <> wrote:

    > If I have a unix user name, is there a way to verify that the user
    > really exists and query default group memberships?


    import pwd
    unix_user_name = raw_input( 'enter a user name:' )
    try:
    print pwd.getpwnam( unix_user_name )
    except KeyError:
    print unix_user_name, 'does not exist'

    There's a grp module for making similar queries against /etc/group (or
    the modern equivalent thereof).

    Regards,
    Dan

    --
    Dan Sommers
    <http://www.tombstonezero.net/dan/>
    Dan Sommers, Jan 19, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QW5kcmV3?=

    What is the best approach to verify a user?

    =?Utf-8?B?QW5kcmV3?=, Nov 2, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    398
    Kevin Spencer
    Nov 3, 2005
  2. John Beschler

    Verify User's credentials

    John Beschler, Sep 18, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    290
    John Beschler
    Sep 18, 2009
  3. asimhg
    Replies:
    0
    Views:
    879
    asimhg
    Feb 4, 2010
  4. Guest

    Verify User Group from ASP.NET

    Guest, Jun 24, 2004, in forum: ASP .Net Security
    Replies:
    4
    Views:
    241
    Joe Kaplan \(MVP - ADSI\)
    Jun 25, 2004
  5. Devin

    Possible to verify user login?

    Devin, Oct 21, 2008, in forum: ASP General
    Replies:
    6
    Views:
    133
    Anthony Jones
    Oct 23, 2008
Loading...

Share This Page