Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PAM authentication problem

I am using this module to authenticate using pam: http://code.google.com/p/web2py/source/browse/gluon/contrib/pam.py

I can call authenticate('username','password') and it returns True/ False. It works for any 'username' but 'root'. My guess is that there is a security restriction in PAM that does not allow to check for the root password.

I need to be able to check the root password. Is there anything I can change in the pam.conf or somewhere else to remove this restriction?

like image 280
mdipierro Avatar asked Apr 30 '10 18:04

mdipierro


People also ask

What is PAM system auth?

The Pluggable Authentication Modules (PAM) feature is an authentication mechanism that allows you to configure how applications use authentication to verify the identity of a user.

What is PAM authentication in SSH?

PAM, in this context, stands for Pluggable Authentication Modules (so we say pluggable authentication modules module 😂). By implementing a module, we can add custom authentication methods for users.

What is Pam Auth update?

pam-auth-update is a utility that permits configuring the central authentication policy for the system using pre-defined profiles as supplied by PAM module packages.


1 Answers

I found the answer to your question, the problem is in the default service.

when you call the function authenticate('username','password') make sure you pass an appropriate service too. like authenticate('username','password', 'passwd') or you can add your custom configuration under /etc/pam.d/

here is an example from the webmin project

#%PAM-1.0
auth    required    pam_unix.so nullok
account required    pam_unix.so
session required    pam_unix.so

write the previous lines on a file under /etc/pam.d/ and call it 'myconfig' for example, then pass it's name to the function, and it'll work (it did for me) :D

like image 73
user330371 Avatar answered Sep 23 '22 01:09

user330371