如何更改Linux NIS主服务器上的密码?

如何更改Linux NIS主服务器上的密码?,第1张

概述这似乎应该很简单,但如果是这样,我一定会遗漏一些东西.我有一个 Linux NIS主机,我希望能够更改用户的密码(在忘记密码和类似的东西的情况下),但我不能. 一些细节:我正在运行Scientific Linux 6.4,使用ypserv-2.19-26,ypbind-1.20.4-30和yp-tools-2.9-12. NIS配置为使用/ etc / yp / passwd作为其passwd映射 这似乎应该很简单,但如果是这样,我一定会遗漏一些东西.我有一个 Linux NIS主机,我希望能够更改用户的密码(在忘记密码和类似的东西的情况下),但我不能.

一些细节:我正在运行ScIEntific linux 6.4,使用ypserv-2.19-26,ypbind-1.20.4-30和yp-tools-2.9-12. NIS配置为使用/ etc / yp / passwd作为其passwd映射(即不是系统passwd文件).系统是其自身的客户端,ypwhich返回“localhost”.

由于非特权用户不应该登录NIS主服务器,因此我们在/etc/nsswitch.conf中设置了以下内容:

passwd:     files compat

这在/ etc / passwd的末尾:

+::::::/bin/false

另外,/ etc / pam.d / passwd包含标准的RHEL指令:

password   substack system-auth

/etc/pam.d/system-auth是/etc/pam.d/system-auth-ac的符号链接,其中包含:

password    requisite     pam_cracklib.so try_first_pass retry=3 type=password    sufficIEnt    pam_unix.so md5 shadow nis nullok try_first_pass use_authtokpassword    required      pam_deny.so

(作为旁注,我们使用的是md5而不是sha512,因为我们有一些不支持sha512的Solaris客户端.)

如果我以root身份运行passwd,它会提示我输入新的passwd,但是后来无法更改它:

$sudo passwd philChanging password for user phil.New password: Retype new password: NIS password Could not be changed.passwd: Authentication token manipulation error

日志文件(/ var / log / secure)无用:

passwd: pam_unix(passwd:chauthtok): password not changed for phil on ypmaster.domain.tld

相反,如果我运行yppasswd,我可以更改密码:

$sudo yppasswd philChanging NIS account information for phil on ypmaster.domain.tld.Please enter root password:Changing NIS password for phil on ypmaster.domain.tld.Please enter new password:Please retype new password:The NIS password has been changed on ypmaster.domain.tld.

但这需要任何需要重置密码的系统管理员才能知道(或从我们锁定的密码安全查找)系统的root密码,这是我想避免的情况.

那么我如何配置主服务器以允许我们更改用户密码而无需每次都输入系统的root密码?

解决方法 正如您所发现的那样,您不能在NIS客户端上以root身份使用passwd来更改NIS服务器上的用户密码.这确实是常识安全.

同样地,您发现yppasswd需要root密码(在NIS服务器上),然后才能更改用户密码.这是一个额外的安全性,因为你应该是NIS管理员(NIS服务器上的root用户)来改变其他人的密码.
不幸的是,那些安全性并不是你想要的,所以yppasswd正在阻碍这里.

I think this is actually a relatively new thing,or an OS-specific variant — back in my Sun admin days when I dealt with NIS regularly yppasswd just trusted you if you were root on the NIS server…

由于您的要求(让授权的管理员更改NIS密码)我建议做的是编写一个shell脚本(或您喜欢的语言),直接编辑NIS映射并重建/推送它们.
您可以通过一些创造性的sed工作来完成此 *** 作,然后授予您的管理员使用sudo运行该脚本的能力.

最终,你可能想考虑离开NIS(LDAP is the new hotness for replacing NIS,几乎是一个替代品,而且更容易管理).

总结

以上是内存溢出为你收集整理的如何更改Linux NIS主服务器上的密码?全部内容,希望文章能够帮你解决如何更改Linux NIS主服务器上的密码?所遇到的程序开发问题。

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

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

原文地址: https://outofmemory.cn/yw/1034528.html

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

发表评论

登录后才能评论

评论列表(0条)

保存