美文网首页
【ansible】ansible user模块添加用户设置密码问

【ansible】ansible user模块添加用户设置密码问

作者: 放纵不基 | 来源:发表于2021-11-30 00:17 被阅读0次

在执行ansible创建用户指定密码的时候,直接passwd=xxx 不行,ansible不认明文的密码,我们需要用python进行加密处理。

# pip install passlib

# python -c "from passlib.hash import sha512_crypt; print sha512_crypt.encrypt('<password>')"

# passwd="PASSWD"

# python -c "from passlib.hash import sha512_crypt; print sha512_crypt.encrypt('"${passwd}"')"

参考 

ansible创建用户时密码问题的踩坑记录

http://www.manongjc.com/detail/13-jjjcthuiddntddf.html

使用ansible-"password"添加新的sudo用户:"NOT_LOGGING_PASSWORD"信息

https://www.it1352.com/1930510.html

How to set default Ansible username/password for SSH connection?

https://serverfault.com/questions/628989/how-to-set-default-ansible-username-password-for-ssh-connection

How To Generate Linux User Encrypted Password for Ansible

https://computingforgeeks.com/generate-linux-user-encrypted-password-for-ansible/

Add user and set password using Ansible

https://unix.stackexchange.com/questions/273316/add-user-and-set-password-using-ansible

Creating a new user and password with Ansible

https://stackoverflow.com/questions/19292899/creating-a-new-user-and-password-with-ansible

相关文章

网友评论

      本文标题:【ansible】ansible user模块添加用户设置密码问

      本文链接:https://www.haomeiwen.com/subject/vpdnzltx.html