I try to create a python script to check the password instead of my computer, So i use python-pam for that. The problem is that i don't know how i can use my script in the common-auth file.
I tried this:
auth required /home/gamzer/test-python-pam.py
But it tells me this:
sudo: PAM unable to dlopen(/home/gamzer/test-python-pam.py): /home/gamzer/test-python-pam.py: invalid ELF header
Here's my script:
import pam
from getpass import getuser, getpass
if pam.authenticate(getuser(), getpass()):
print 'ok'
else:
print 'not ok'