473,395 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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):
http://publib16.boulder.ibm.com/doc_...tm#lwurf19cjef
______________________

Thanks,
Litening
Nov 13 '05 #1
3 5362
In article <d3**************************@posting.google.com >,
Litening <go****@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.
Nov 13 '05 #2
Darren Tucker wrote:
In article <d3**************************@posting.google.com >,
Litening <go****@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.

Nov 13 '05 #3
In article <dm**************@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.
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Renato Neves | last post by:
The following code is working fine, i can create the user in the Active Directory and "enable" it. My problem is that, when i'm trying to authenticate him, i can't get to work!! The user and pass...
2
by: allenj | last post by:
DB2 UDB 7.2 WSE Fixpak 9 Linux Red Hat 7.3 A very strange thing just happened w/ my DB2 server. I am on Linux and using NIS - the instance owner is in the servers /etc/passwd file. Suddenly,...
3
by: Ram | last post by:
How to Authenticate NDS server using C#
3
by: mike | last post by:
Hello. I have a web site that is using Basic Authentication (yes, I am using HTTPS) and is sessionless (I am maintaining session state in a database via a custom component). When the user...
13
by: ALI-R | last post by:
I know how to authenticate to a webservice using either of these ways(Assuming that rService represents the webservice): 1) rService.Credentials = new...
1
by: EricRybarczyk | last post by:
I am starting a rewrite of an existing Classic ASP web site in ASP.NET 2.0. The existing ASP application has several types of users, each with a separate login process (separate login page,...
1
by: kevin.vaughan | last post by:
Hello Everyone, Is it possible to authenticate the windows password through Active Directory? If so, how would this be done. I have a login screen in my application and am trying to set it up...
1
by: Michael Howes | last post by:
I would think this would be very, very easy but in the 50 searches I've done I haven't found anything. If our application requires login and that user/password be a local windows account or more...
4
by: Jon | last post by:
I am modifying an app for a customer in ASP.Net 1.1. The app is running on a server outside their network, yet they want to authenticate users against their internal active directory set up (they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.