linux – 如何通过puppet安全地禁用用户密码?

linux – 如何通过puppet安全地禁用用户密码?,第1张

概述我的SSH服务器设置只使用公钥认证,禁用密码认证. 通过puppet添加用户时,我想禁用用户密码. 到目前为止,我已经提出了这个,这似乎有效,但我不确定这有多安全: user { 'john': ensure => 'present', comment => 'John Smith', groups => ['adm','sudo','wheel',' 我的SSH服务器设置只使用公钥认证,禁用密码认证.

通过puppet添加用户时,我想禁用用户密码.

到目前为止,我已经提出了这个,这似乎有效,但我不确定这有多安全:

user { 'john':    ensure     => 'present',comment    => 'John Smith',groups     => ['adm','sudo','wheel','users'],home       => '/home/john',managehome => true,shell      => '/bin/bash',password   => '*',}

正在使用密码=> ‘*’定义被认为可以安全地禁用用户密码?

解决方法 shadow(5)手册页说

If the password fIEld contains some string that is not a valID result of crypt(3),for instance ! or *,the user will not be able to use a unix password to log in (but the user may log in the system by other means).

所以是的,使用*是安全的.的! passwd(1)使用加密密码的第一个字符来表示密码被锁定(passwd -l),这可以解锁(passwd -u).

总结

以上是内存溢出为你收集整理的linux – 如何通过puppet安全地禁用用户密码?全部内容,希望文章能够帮你解决linux – 如何通过puppet安全地禁用用户密码?所遇到的程序开发问题。

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

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

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

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

发表评论

登录后才能评论

评论列表(0条)

保存