# Change own password from non-root account

**URL:** <https://forum.ansible.com/t/change-own-password-from-non-root-account/23596>\
**Category:** Ansible Project\
**Created:** [January 30, 2017, 2:03pm UTC](https://forum.ansible.com/t/change-own-password-from-non-root-account/23596 "2017-01-30T14:03:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhh](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@mhh](https://forum.ansible.com/u/mhh)\
**Post date:** [January 30, 2017, 2:03pm UTC](https://forum.ansible.com/t/change-own-password-from-non-root-account/23596/1 "2017-01-30T14:03:53Z")

</div>

Is possible to change own password from non-root account ?  
I found example, but it is not working. I did not find any info about ansible\_ssh\_newpass variable.

Playbook

- hosts: my  
tasks:
- shell: ‘printf “%s\n” oldpass newpass newpass | passwd’

Iventory  
[my]  
[myexample.com](http://myexample.com)

[my:vars]  
ansible\_connection=ssh  
ansible\_ssh\_user=myuser  
ansible\_ssh\_pass=oldpass  
ansible\_ssh\_newpass=newpass  
ansible\_ssh\_common\_args=‘-o StrictHostKeyChecking=no’

[http://serverfault.com/questions/779165/via-ansible-change-password-of-non-root-account-using-passwd-command-and-picking?answertab=votes#tab-top](http://serverfault.com/questions/779165/via-ansible-change-password-of-non-root-account-using-passwd-command-and-picking?answertab=votes#tab-top)

EDIT:  
I found that shell: ‘printf “%s\n” oldpass newpass newpass | passwd’ actually works only when your password is not expired, and if you already logged on the server.  
Can anyone confirm it? Is there any proper way to change it? Thanks

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 30, 2017, 2:49pm UTC](https://forum.ansible.com/t/change-own-password-from-non-root-account/23596/2 "2017-01-30T14:49:45Z")

</div>

The variable ansible\_ssh\_newpass is not something Ansible knows about nor supports.
