# Reg password change

**URL:** https://discourse.chef.io/t/reg-password-change/6684
**Category:** Chef Infra (archive)
**Created:** [June 22, 2015, 10:21am UTC](https://discourse.chef.io/t/reg-password-change/6684 "2015-06-22T10:21:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Indra\_k](https://avatars.discourse-cdn.com/v4/letter/i/c89c15/32.png) [@Indra\_k](https://discourse.chef.io/u/Indra_k)
#### Post date: [June 22, 2015, 10:21am UTC](https://discourse.chef.io/t/reg-password-change/6684/1 "2015-06-22T10:21:08Z")

</div>

Hi all,  
I need to change password for vm .After logging vm with its user and password,it prompts for new [password.Is](http://password.Is) this possible to set new password through cookbook.  
Regards,Indra

---

<div class="post-metadata">

### Author: ![Drew\_Blessing1](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/drew_blessing1/32/51_2.png) [@Drew\_Blessing1](https://discourse.chef.io/u/Drew_Blessing1)
#### Post date: [June 22, 2015, 11:54am UTC](https://discourse.chef.io/t/reg-password-change/6684/2 "2015-06-22T11:54:02Z")

</div>

Look at the 'users' cookbook. It allows managing user passwords as well as SSH keys and other user attributes.

[https://supermarket.chef.io/cookbooks/users](https://supermarket.chef.io/cookbooks/users)

> On Jun 22, 2015, at 5:21 AM, Indra k [indra.k@cloudenablers.com](mailto:indra.k@cloudenablers.com) wrote:
> 
> Hi all,
> 
> ```
> I need to change password for vm .After logging vm with its user and password,it prompts for new password.Is this possible to set new password through cookbook.
> 
> ```
> 
> Regards,  
> Indra

---

<div class="post-metadata">

### Author: ![Indra\_k](https://avatars.discourse-cdn.com/v4/letter/i/c89c15/32.png) [@Indra\_k](https://discourse.chef.io/u/Indra_k)
#### Post date: [June 22, 2015, 12:14pm UTC](https://discourse.chef.io/t/reg-password-change/6684/3 "2015-06-22T12:14:10Z")

</div>

Thanks drew,  
Through cookbook we can set like this.But I need to change password once i login to vm .  
IIn cookbook case first we need to install chef and then only we run that cookbook. So how is this possible to change password once login without cookbook from remote.

```
  From: "drew@blessing.io" <drew@blessing.io>

```

To: Indra k [indra.k@cloudenablers.com](mailto:indra.k@cloudenablers.com)  
Cc: Chef [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Sent: Monday, 22 June 2015 5:24 PM  
Subject: Re: [chef] reg password change

Look at the ‘users’ cookbook. It allows managing user passwords as well as SSH keys and other user attributes.  
[https://supermarket.chef.io/cookbooks/users](https://supermarket.chef.io/cookbooks/users)

On Jun 22, 2015, at 5:21 AM, Indra k [indra.k@cloudenablers.com](mailto:indra.k@cloudenablers.com) wrote:

Hi all,  
I need to change password for vm .After logging vm with its user and password,it prompts for new [password.Is](http://password.Is) this possible to set new password through cookbook.  
Regards,Indra

---

<div class="post-metadata">

### Author: ![werebus](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/werebus/32/24_2.png) [@werebus](https://discourse.chef.io/u/werebus)
#### Post date: [June 22, 2015, 12:54pm UTC](https://discourse.chef.io/t/reg-password-change/6684/4 "2015-06-22T12:54:48Z")

</div>

So, to clarify:

Is it that you want Chef to create a user with a password, but when that  
user first logs in for them to be forced to manually change their password?  
Or, do you want Chef to change their password if they’ve logged in  
successfully once? I assume that it’s the first case; seems like a more  
likely use-case. What operating system is on the VM?

I suspect the answer to this is going to involve some sort of execute  
[https://docs.chef.io/resource\_execute.html](https://docs.chef.io/resource_execute.html) call to chage  
[http://linux.die.net/man/1/chage](http://linux.die.net/man/1/chage), but I’d need a bit more information to  
be sure.

Matt Moretti  
​

On Mon, Jun 22, 2015 at 8:14 AM, Indra k [indra.k@cloudenablers.com](mailto:indra.k@cloudenablers.com) wrote:

> Thanks drew,
> 
> ```
> Through cookbook we can set like this.But I need to change
> 
> ```
> 
> password once i login to vm .
> 
> ```
> IIn cookbook case first we need to install chef and then only we
> 
> ```
> 
> run that cookbook. So how is this possible to change password once login  
> without cookbook from remote.
> 
> * * *
> 
> _From:_ "[drew@blessing.io](mailto:drew@blessing.io)" [drew@blessing.io](mailto:drew@blessing.io)  
> _To:_ Indra k [indra.k@cloudenablers.com](mailto:indra.k@cloudenablers.com)  
> _Cc:_ Chef [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> _Sent:_ Monday, 22 June 2015 5:24 PM  
> _Subject:_ Re: [chef] reg password change
> 
> Look at the 'users' cookbook. It allows managing user passwords as well as  
> SSH keys and other user attributes.
> 
> [https://supermarket.chef.io/cookbooks/users](https://supermarket.chef.io/cookbooks/users)
> 
> On Jun 22, 2015, at 5:21 AM, Indra k [indra.k@cloudenablers.com](mailto:indra.k@cloudenablers.com) wrote:
> 
> Hi all,
> 
> ```
> I need to change password for vm .After logging vm with its
> 
> ```
> 
> user and password,it prompts for new password.Is this possible to set new  
> password through cookbook.
> 
> Regards,  
> Indra
