PAM authentication problem

前端 未结 3 1917
小鲜肉
小鲜肉 2021-01-03 04:55

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\

相关标签:
3条回答
  • 2021-01-03 05:18

    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

    0 讨论(0)
  • 2021-01-03 05:18

    You could use sshd configuration if its a system with ssh server running and should work for root.

    authenticate('root','password',service='sshd')

    0 讨论(0)
  • 2021-01-03 05:26

    I had the same issue root was not getting authenticated. here is the fix

    If you use the service 'login' it wont work for root. use,

    #authenticate('username','password',service='system-auth')
    
    0 讨论(0)
提交回复
热议问题