We are going to develop PAM application to check whether user is authenticated or not not using PAM. The detail tutorial about PAM can be found here.



First install the library for PAM in linux, in my case it is Ubuntu:

After that, I write the code like this:

Then, compile the code with dynamically linking to pam and pam_misc libraries:

And, also configure the PAM as:

Finally, Run the application as:


You can check the libraries are loaded or not as:


That’s it. Cheers!!