Hi,
Please suggest me the way how to change password of a minion through salt master.
Thanks,
Abhishek Jain
If by "change the password of a minion" you mean change the password of a user on the minion system, you should use the user.present
state. Note that you need a password hash, not a cleartext password, which you can generate using shadow.gen_password
:
# salt '*' shadow.gen_password mypassword
basepi-debian:
$6$EsYe5SZH$X7eH65bYsr8DR2mJfHACmZs5nspN4OPT/kerYlYyKRDZwYlMWvtnnhTPiIsc8DDQxPSf1kvH.RLL6usqVOYFn1
You can use this password hash in the user.present
state like so:
basepi_user:
user.present:
- name: basepi
- password: $6$EsYe5SZH$X7eH65bYsr8DR2mJfHACmZs5nspN4OPT/kerYlYyKRDZwYlMWvtnnhTPiIsc8DDQxPSf1kvH.RLL6usqVOYFn1
Note that you should probably put that password hash into a Pillar value and fetch it from there to be more secure.
Closing since question has been answered.
Most helpful comment
If by "change the password of a minion" you mean change the password of a user on the minion system, you should use the
user.present
state. Note that you need a password hash, not a cleartext password, which you can generate usingshadow.gen_password
:You can use this password hash in the
user.present
state like so:Note that you should probably put that password hash into a Pillar value and fetch it from there to be more secure.