Basic example ?

Asked by sebsauvage

It is possible to have a basic example of a python-pam module implementation ?
(along with how to install it.)

The example provided in /usr/share/doc/python-pam/examples/pamtest.py is not commented.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu python-pam Edit question
Assignee:
No assignee Edit question
Solved by:
Dominik
Solved:
Last query:
Last reply:
Revision history for this message
Best Dominik (domfi) said :
#1

Hello sebsauvage,

as far as I can see "python-pam" gives you the ability to authenticate via PAM from within your python scripts.
So you can make your python-scripts use - for example - pam_unix to authenticate an user. It is not meant to build a PAM module with python. For security reasons PAM modules - IMO - should never be written in an interpreted language especially not to authenticate users.

There's a PAM module which allows to start scripts for the "session" part of pam. You might want to have a look at this -> http://freshmeat.net/projects/pam_script.

If you want a commented example of how to do authentication with python-pam let me know. I then will try to create one for you.

Cheers,
Dominik

Revision history for this message
sebsauvage (sebsauvage) said :
#2

> It is not meant to build a PAM module with python.

Oh... I see.
That's what I thought.

Thank your for the link to pam_script.

Revision history for this message
sebsauvage (sebsauvage) said :
#3

Thanks Dominik, that solved my question.