linux – 无法使用useradd添加用户

linux – 无法使用useradd添加用户,第1张

概述尝试将(不存在的)用户添加到我的CentOS系统是返回useradd:用户示例存在.我可以成功地手动将用户添加到/ etc / passwd和/ etc / shadow,但是这种解决方法是A Bad Thing.用户存在于LDAP中,但PAM未使用LDAP进行身份验证.添加其他用户工作正常.我很难过. ETA: [root ~]# userdel exampleuserdel: error d 尝试将(不存在的)用户添加到我的CentOS系统是返回useradd:用户示例存在.我可以成功地手动将用户添加到/ etc / passwd和/ etc / shadow,但是这种解决方法是A Bad Thing.用户存在于LDAP中,但PAM未使用LDAP进行身份验证.添加其他用户工作正常.我很难过.

ETA:

[root ~]# userdel exampleuserdel: error deleting password entryuserdel: error deleting shadow password entry[root ~]# useradd exampleuseradd: user example exists[root ~]# su examplebash-3.2$whoamiexamplebash-3.2$groups exampleexample : Usersbash-3.2$cdbash: cd: /home/example: No such file or directorybash-3.2$
解决方法 如果在/etc/nsswitch.conf中包含LDAP(例如passwd:files ldap或passwd:compat passwd_compat:ldap等),则getent passwd就足够了,因此useradd可以查看LDAP条目.

这两个实用程序都与PAM无关,即使PAM对LDAP一无所知,也很乐意识别LDAP条目.

顺便说一句,如果你有nscd运行,请记得在更改nsswitch.conf后重新启动它.

总结

以上是内存溢出为你收集整理的linux – 无法使用useradd添加用户全部内容,希望文章能够帮你解决linux – 无法使用useradd添加用户所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1035087.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存