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

我的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).

相关文章

1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...
1 删除0字节文件 find -type f -size 0 -exec rm -rf {} ...
## 步骤 1:安装必要的软件包 首先,需要确保系统已安装 `dh...