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

在执行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】ansible user模块添加用户设置密码问题

参考 

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

© 版权声明
THE END
如果内容对您有所帮助,就支持一下吧!
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容