尝试将(不存在的)用户添加到我的 CentOS 系统时返回useradd: user example exists
. 我可以成功地手动将用户添加到 /etc/passwd 和 /etc/shadow,但这种解决方法是一件坏事。用户存在于 LDAP 中,但 PAM 未使用 LDAP 进行身份验证。添加其他用户工作正常。我难住了。
预计到达时间:
[root ~]# userdel example
userdel: error deleting password entry
userdel: error deleting shadow password entry
[root ~]# useradd example
useradd: user example exists
[root ~]# su example
bash-3.2$ whoami
example
bash-3.2$ groups example
example : Users
bash-3.2$ cd
bash: cd: /home/example: No such file or directory
bash-3.2$
Run Code Online (Sandbox Code Playgroud)
kub*_*zyk 10
如果包含在LDAP /etc/nsswitch.conf
(例如passwd: files ldap
或 passwd:compat passwd_compat:ldap
等)就足够了getent passwd
,因此对于useradd
看LDAP条目。
这两个实用程序都与 PAM 无关,即使 PAM 对 LDAP 一无所知,也很高兴识别 LDAP 条目。
顺便说一句,如果你有nscd
运行过,记得改完后重启一下nsswitch.conf
。
归档时间: |
|
查看次数: |
10002 次 |
最近记录: |