I need to do a simple authentication of username's which are on the host and NIS.
I am writing this code in Python.
I tried using PAM to do authentication. For this I downloaded a Python module called Python Pam.
The code I use :
import pam
pam.authenticate('root',<password>,<service>)
where <service> is a config file I created in /etc/pam.d/
the file contains the following code
#%PAM-1.0
auth requisite pam_unix.so
This code works on certain hosts giving the correct answer, but not on others
Even if I replaced <service> with login or sshd as in
pam.authenticate('root',<password>,'sshd')
It still returns False for a correct password on certain hosts.
So does anybody know why this does not work. I don't need to use pam or any module. Is there any command in unix that I can invoke from Python which would just authenticate a username? and preferably work across all unix based systems including Linux, Solaris, HP-UX, AIX.
Thanks