PAM authentication problem

断了今生、忘了曾经 提交于 2019-11-30 14:39:53

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

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')

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!