C program to authenticate user on AIX?

Ask a Question related to AIX, Design and Development.

  1. #1

    Default C program to authenticate user on AIX?

    Hi

    Can someone please supply me with a program (perhaps the C source)
    that authenticates a user on AIX (against the password/shadow/security
    file(s))?

    So far I have the following from IBM, but I don't know how to
    implement it (I'm not really a programmer):

    _______________________
    <CUT>
    authenticate Subroutine

    Purpose
    Verifies a user's name and password.

    Library
    Security Library (libc.a)

    Syntax
    #include <usersec.h>

    int authenticate (UserName, Response, Reenter, Message)
    char *UserName;
    char *Response;
    int *Reenter;
    char **Message;

    </CUT>
    ______________________
    Taken from the following link (which has more info):
    [url]http://publib16.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/ls_sec_audit_subrs.htm#lwurf19cjef[/url]
    ______________________

    Thanks,
    Litening
    Litening Guest

  2. Similar Questions and Discussions

    1. Authenticate user - HTTP/1.1 500 Server Error
      When using Authenticate User behavior I get HTTP/1.1 500 Server Error. Only on remote server, not localhost. The host first tried to tell me it...
    2. How to authenticate a user who already logged on another web server
      IMO, the technology is behaving as designed. Both applications require credentials to function...neither is aware that they other has already...
    3. Running program in exec() in Windows with a different user
      Hi, I have been using exec() and shell_exec() quite fine many times. My problem now is that applications runned thru exec() and shell_exec() (and...
    4. Please help w/burning a IMG file of a MAC program with a PC for a MAC user
      Hi all, I have an IMG file and I don't know what program created it although I do know that it is an image file of a MAC program. My question is,...
    5. Urgent Help on Authenticate Database User
      Dear all, I'm having a problem here. Suppose I have a database which store the username and password, the user must login in order to use the...
  3. #2

    Default Re: C program to authenticate user on AIX?

    In article <d3d692b9.0307301518.4de7e749@posting.google.com >,
    Litening <google@zxmoon.com> wrote:
    >Can someone please supply me with a program (perhaps the C source)
    >that authenticates a user on AIX (against the password/shadow/security
    >file(s))?
    Take a look at OpenSSH's auth-passwd.c. There's not a lot to it, it's
    basically:

    char *authmsg, *user, *password;
    int reenter, result;

    /* get username and password from user */
    [...]

    result = authenticate(user, password, &reenter, &authmsg);

    /* check result, 0 = succeeded */
    [...]

    By rights you should loop until reenter == 0 but OpenSSH doesn't
    (currently).

    If you're using a *really* old AIX, you'll need to link with libs.a
    (cc [options] -ls).

    Hey, does anyone actually use a multi-step authentication process,
    or secondary authentication methods? Can anyone point me to an example?
    I've tried Google and read the "Elements of Security" Redbook.

    --
    Darren Tucker (dtucker at zip.com.au)
    GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
    usually comes from bad judgement.
    Darren Tucker Guest

  4. #3

    Default Re: C program to authenticate user on AIX?

    Darren Tucker wrote:
    > In article <d3d692b9.0307301518.4de7e749@posting.google.com >,
    > Litening <google@zxmoon.com> wrote:
    >
    >>Can someone please supply me with a program (perhaps the C source)
    >>that authenticates a user on AIX (against the password/shadow/security
    >>file(s))?
    >
    >
    > Take a look at OpenSSH's auth-passwd.c. There's not a lot to it, it's
    > basically:
    >
    > char *authmsg, *user, *password;
    > int reenter, result;
    >
    > /* get username and password from user */
    > [...]
    >
    > result = authenticate(user, password, &reenter, &authmsg);
    >
    > /* check result, 0 = succeeded */
    > [...]
    >
    > By rights you should loop until reenter == 0 but OpenSSH doesn't
    > (currently).
    >
    > If you're using a *really* old AIX, you'll need to link with libs.a
    > (cc [options] -ls).
    >
    > Hey, does anyone actually use a multi-step authentication process,
    > or secondary authentication methods? Can anyone point me to an example?
    > I've tried Google and read the "Elements of Security" Redbook.
    >
    Not sure if this is what you are looking for but I created my own
    secondary authentication for our system. Once a user logs into our AIX
    system I run a program that asks for their password. This is checked
    not only for being valid but also if they are allowed "normal" access to
    the TTY or telnet address they are loggin into. If they aren't it asks
    for an "override" code. If this code is entered correctly the program
    continues otherwise it locks up the session until a supervisor clears
    it. The user's password that they entered in my program is also used to
    control what programs they can run. It is also logged into a log that
    is printed monthly.
    The above was instituted because people were misusing passwords and in
    one case set our company up for a lawsuit. Once their attorney was told
    we had proof that their client's nephew had set us up the lawsuit was
    quickly dropped. I then instituted the controls on requiring override
    codes for supervisors.

    Michael W Ryder Guest

  5. #4

    Default Re: C program to authenticate user on AIX?

    In article <dm3Wa.416$jp.213@newsread4.news.pas.earthlink.net >,
    Michael W Ryder <mwryder@_earthlink_.net> wrote:
    >Darren Tucker wrote:
    >> Hey, does anyone actually use a multi-step authentication process,
    >> or secondary authentication methods? Can anyone point me to an example?
    >> I've tried Google and read the "Elements of Security" Redbook.
    >>
    >Not sure if this is what you are looking for but I created my own
    >secondary authentication for our system.
    [snip description]

    I'm specifically interested in any implementation using AIX's
    PRIMARY or SECONDARY authentication methods (ie something other than
    "SYSTEM" for "authentication method" under SMIT/user). I'd like to test
    OpenSSH's behaviour in those configurations.

    If your system uses those, is the code available?

    (followup-to set)

    --
    Darren Tucker (dtucker at zip.com.au)
    GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
    usually comes from bad judgement.
    Darren Tucker Guest

  6. #5

    Default Re: C program to authenticate user on AIX?

    In comp.unix.aix Darren Tucker <dtucker@dodgy.net.au> wrote:
    DT> In article <dm3Wa.416$jp.213@newsread4.news.pas.earthlink.net >,
    DT> Michael W Ryder <mwryder@_earthlink_.net> wrote:
    >>Darren Tucker wrote:
    >>> Hey, does anyone actually use a multi-step authentication process,
    >>> or secondary authentication methods? Can anyone point me to an example?
    >>> I've tried Google and read the "Elements of Security" Redbook.
    >>>
    >>Not sure if this is what you are looking for but I created my own
    >>secondary authentication for our system.
    DT> [snip description]

    DT> I'm specifically interested in any implementation using AIX's
    DT> PRIMARY or SECONDARY authentication methods (ie something other than
    DT> "SYSTEM" for "authentication method" under SMIT/user). I'd like to test
    DT> OpenSSH's behaviour in those configurations.

    DT> If your system uses those, is the code available?

    I think in AIX 5.1 PRIMARY and SECONDARY went away. Loadable
    authentication modules are the new regime. They're PAM-ish.

    Regards,

    Nicholas

    --
    "Why shouldn't I top-post?" [url]http://www.aglami.com/tpfaq.html[/url]
    "Meanings are another story." [url]http://www.ifas.org/wa/glossolalia.html[/url]
    Nicholas Dronen Guest

  7. #6

    Default Re: C program to authenticate user on AIX?

    In article <3f295a70$0$190$75868355@news.frii.net>,
    Nicholas Dronen <ndronen@io.frii.com> wrote:
    >In comp.unix.aix Darren Tucker <dtucker@dodgy.net.au> wrote:
    >DT> I'm specifically interested in any implementation using AIX's
    >DT> PRIMARY or SECONDARY authentication methods (ie something other than
    >DT> "SYSTEM" for "authentication method" under SMIT/user). I'd like to test
    >DT> OpenSSH's behaviour in those configurations.
    >
    >I think in AIX 5.1 PRIMARY and SECONDARY went away. Loadable
    >authentication modules are the new regime. They're PAM-ish.
    Primary and Secondary authentication methods are still there in 5.2,
    as is the authenticate() call, so I think it will need to be supported
    for the forseeable future.

    --
    Darren Tucker (dtucker at zip.com.au)
    GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
    usually comes from bad judgement.
    Darren Tucker Guest

  8. #7

    Default Re: C program to authenticate user on AIX?

    Darren Tucker <dtucker@dodgy.net.au> wrote:
    DT> In article <3f295a70$0$190$75868355@news.frii.net>,
    DT> Nicholas Dronen <ndronen@io.frii.com> wrote:
    >>In comp.unix.aix Darren Tucker <dtucker@dodgy.net.au> wrote:
    >>DT> I'm specifically interested in any implementation using AIX's
    >>DT> PRIMARY or SECONDARY authentication methods (ie something other than
    >>DT> "SYSTEM" for "authentication method" under SMIT/user). I'd like to test
    >>DT> OpenSSH's behaviour in those configurations.
    >>
    >>I think in AIX 5.1 PRIMARY and SECONDARY went away. Loadable
    >>authentication modules are the new regime. They're PAM-ish.
    DT> Primary and Secondary authentication methods are still there in 5.2,
    DT> as is the authenticate() call, so I think it will need to be supported
    DT> for the forseeable future.

    What do you mean by "still there"?

    IIRC, my shop had a secondary authentication method that stopped
    working at 5.1. I had to rewrite it as a loadable authentication
    module (which is partly just a user-implemented version of
    authenticate()).

    Regards,

    Nicholas

    --
    "Why shouldn't I top-post?" [url]http://www.aglami.com/tpfaq.html[/url]
    "Meanings are another story." [url]http://www.ifas.org/wa/glossolalia.html[/url]
    Nicholas Dronen Guest

  9. #8

    Default Re: C program to authenticate user on AIX?

    In article <3f2aa6c9$0$200$75868355@news.frii.net>,
    Nicholas Dronen <ndronen@io.frii.com> wrote:
    [Primary and Secondary Authentication methods]
    >What do you mean by "still there"?
    The options to set them are still present in SMIT/users.
    >IIRC, my shop had a secondary authentication method that stopped
    >working at 5.1. I had to rewrite it as a loadable authentication
    >module (which is partly just a user-implemented version of
    >authenticate()).
    I don't know if they work or not, I started this thread looking for an
    example I could play with.

    --
    Darren Tucker (dtucker at zip.com.au)
    GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
    usually comes from bad judgement.
    Darren Tucker Guest

  10. #9

    Default Re: C program to authenticate user on AIX?

    Darren Tucker <dtucker@dodgy.net.au> wrote:
    DT> In article <3f2aa6c9$0$200$75868355@news.frii.net>,
    DT> Nicholas Dronen <ndronen@io.frii.com> wrote:
    DT> [Primary and Secondary Authentication methods]
    >>What do you mean by "still there"?
    DT> The options to set them are still present in SMIT/users.

    I doubt they work. Could be wrong.
    >>IIRC, my shop had a secondary authentication method that stopped
    >>working at 5.1. I had to rewrite it as a loadable authentication
    >>module (which is partly just a user-implemented version of
    >>authenticate()).
    DT> I don't know if they work or not, I started this thread looking for an
    DT> example I could play with.

    I had to use the a loadable module with a method_authenticate function:

    [url]http://publib16.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/kernextc/sec_load_mod.htm[/url]

    Regards,

    Nicholas

    --
    "Why shouldn't I top-post?" [url]http://www.aglami.com/tpfaq.html[/url]
    "Meanings are another story." [url]http://www.ifas.org/wa/glossolalia.html[/url]
    Nicholas Dronen Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139