我有ldap的问题,当它在线,我login用户/从LDAP数据库传递,然后不能su本地通过根。 当我关掉离线LDAP时,我可以用本地用户/密码login,用本地密码sulogin。 auth.log:
Sep 27 12:18:33 intranet sshd[18321]: pam_unix(sshd:session): session opened for user mejmo by (uid=0) Sep 27 12:18:39 intranet unix_chkpwd[18340]: check pass; user unknown Sep 27 12:18:39 intranet unix_chkpwd[18340]: password check failed for user (root) Sep 27 12:18:39 intranet su[18339]: pam_unix(su:auth): authentication failure; logname=mejmo uid=10009 euid=10009 tty=/dev/pts/1 ruser=mejmo rhost= user=r Sep 27 12:18:42 intranet su[18339]: pam_authenticate: Permission denied Sep 27 12:18:42 intranet su[18339]: FAILED su for root by mejmo
我正在input正确的密码,因为我可以在LDAP服务器处于脱机状态时login。 请帮忙,疯了…
编辑:我想通了,当我在本地创build用户,在线转LDAP,然后我可以su根。 我认为问题是,pam_unix无法看到使用su的用户,因为passwd中没有条目,但是nssswitch.conf可以(passwd,shadow等文件ldap)。
EDIT2:
account sufficient pam_ldap.so debug account sufficient pam_unix.so audit auth sufficient pam_ldap.so auth sufficient pam_unix.so audit likeauth use_first_pass auth required pam_deny.so
编辑3:它适用于nscd运行,但它确实令人讨厌的日志,偶尔我无法login..哪里可能是与nscd的问题? 🙁
Sep 27 16:27:35 intranet sshd[25830]: pam_ldap: ldap_simple_bind Can't contact LDAP server Sep 27 16:27:35 intranet sshd[25830]: pam_ldap: reconnecting to LDAP server... Sep 27 16:27:35 intranet sshd[25830]: pam_ldap: ldap_simple_bind Can't contact LDAP server
你确定你先检查本地authentication,然后LDAP后端?
检查你的/etc/nsswitch.conf
它应该显示:
passwd:文件ldap组:文件ldap shadow:文件ldap
或者也可以是“compat”选项
编辑:
在我的RHEL机器上,nscd一直是问题的来源,造成了你从来没有想过从nscd那里得到的错误。 所以答案是肯定的,nscd可能是这种奇怪行为的原因。 在testing过程中,您应该尝试清理nscd的caching。
nscd -i passwd nscd -i组
来自LDAP的用户是否在正确的组中对su执行su操作?
通常这是轮组,但在您的环境中可能会有所不同。