简体   繁体   English

如何使用Ansible删除系统用户密码

[英]How to remove a system user password with Ansible

I have a system user on all of my systems that gets a default password; 我所有系统上都有一个系统用户,该用户获得默认密码。 we're using a vendor for this, and we aren't able to remove the password from the initial setup. 我们正在为此使用供应商,因此我们无法从初始设置中删除密码。

We're currently setting the shell to nologin; 我们目前正在将shell设置为nologin; is there any way with the User module to remove the password? 用户模块有什么办法可以删除密码?

I could use the shell module to replace the password with !! 我可以使用shell模块将密码替换为!! in the shadow file, but I feel like Ansible probably has a better solution, and I just haven't found it yet. 在影子文件中,但我觉得Ansible可能有更好的解决方案,但我还没有找到它。

The last time I looked into this, there was no "good" solution. 我上次查看此内容时,没有“好的”解决方案。 I do something like this when I need to: 我需要执行以下操作时:

- name: Lock root password
  user: name=root password='!'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM