PAM认证问题

发布于 2024-08-30 13:31:18 字数 372 浏览 6 评论 0原文

我正在使用此模块通过 pam 进行身份验证: http://code.google.com/p/web2py /source/browse/gluon/contrib/pam.py

我可以调用authenticate('username','password'),它返回True/False。它适用于除“root”之外的任何“用户名”。我的猜测是 PAM 中有一个安全限制,不允许检查 root 密码。

我需要能够检查 root 密码。我可以在 pam.conf 或其他地方更改任何内容来消除此限制吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

葵雨 2024-09-06 13:31:18

我找到了你问题的答案,问题出在默认服务上。

当您调用函数authenticate('username','password')时,请确保您也传递了适当的服务。
像authenticate('用户名','密码','passwd')
或者您可以在 /etc/pam.d/ 下添加自定义配置,

这是 webmin 项目中的一个示例,

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

将前面的行写入 /etc/pam.d/ 下的文件中,并将其命名为“myconfig”,然后将其传递给为函数命名,它会起作用(它对我有用):D

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

无法言说的痛 2024-09-06 13:31:18

我遇到了同样的问题,根未得到身份验证。这是修复方法。

如果您使用“登录”服务,它将不适用于 root。使用,

#authenticate('username','password',service='system-auth')

I had the same issue root was not getting authenticated. Here's the fix.

If you use the service 'login' ,it won't work for root. Use,

#authenticate('username','password',service='system-auth')
凉城已无爱 2024-09-06 13:31:18

如果系统运行 ssh 服务器并且应该适用于 root,则可以使用 sshd 配置。

验证('root','密码',service='sshd')

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文