PAM Authentication Sample

Hi,

I am a Linux / Unix newbie c programmer.

I have a c/c++ daemon server that will receive authentication (userid / password) from a windows client.

All I want to do is authenticate the user via PAM API - i.e. user must exist on the Unix / Linux system + password must be validated.

I've tried desperately hard to get this working using the PAM API, however does not seem to work at all. Don't know what I'm doing wrong.

Can anyone please send me a step by step guide and some sample code to be able to do this thru the PAM API. The userid and password params must be passed programmatically, and must not be prompted for on the server side.

THANX.

Phrack as a nice walk through of configuring PAM and some sample code for the API. Take a look at PHRACK Pam walkthrough

Cheers,

Keith