Managing a user password for linux in puppet

后端 未结 8 974
心在旅途
心在旅途 2020-12-07 16:00

I need to create a test user with a password using puppet.

I\'ve read that puppet cannot manage user passwords in a generic cross-platform way, which is a pity. I am

8条回答
  •  没有蜡笔的小新
    2020-12-07 16:17

    The sha1 function in puppet is not directly intended for passwd entries, as you figured out. I'd say setting the hash rather than the password is good practice! You are not really supposed to be able to recover a password anyway - you can generate it once, or you can have puppet generate it every time - generating that hash once should be enough IMHO... You can generate a password on Debian/Ubuntu like this:

    pwgen -s -1 | mkpasswd -m sha-512 -s
    

    ...on CentOS you can use some grub-crypt command instead of mkpasswd...

提交回复
热议问题