# Can't login Aix machine by the account that was created by Ansible user module.

**URL:** <https://forum.ansible.com/t/cant-login-aix-machine-by-the-account-that-was-created-by-ansible-user-module/27599>\
**Category:** Ansible Project\
**Created:** [May 23, 2018, 11:24am UTC](https://forum.ansible.com/t/cant-login-aix-machine-by-the-account-that-was-created-by-ansible-user-module/27599 "2018-05-23T11:24:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaolong\_t](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shaolong\_t](https://forum.ansible.com/u/shaolong_t)\
**Post date:** [May 23, 2018, 11:24am UTC](https://forum.ansible.com/t/cant-login-aix-machine-by-the-account-that-was-created-by-ansible-user-module/27599/1 "2018-05-23T11:24:29Z")

</div>

Hello everybody,

I am using Ansible user module to create Aix machine account. I found that the new created user can’t login Aix machine.

The below is my some test step;

1. Generate a crypted password by ansible provided method. The cleartext password is “123456”  
[http://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module](http://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module)

2. Use below command to create a new Aix user successful.  
ansible 192.168.2.\*\*\* -m “user” -a “state=present name=ray password=$6$PbSwE6eWakaP9VSl$GjZhuR5.6ICTM6K/.91gss2iYbhJoLU1B51XXqxCMIcVi17IMAegxlcfWNfWkuYkldRuKJLw9xjTp/F4.hFYq0”

3. Login Aix machine with the new user failed. The reason is error password.

If we get a crypted password by Aix from /etc/security/passwd, replace the above password that was crypted by ansible doc with the new crypted password. We can login Aix with new account.

So, the issue reason should be Aix machine can’t accept the cryted password that is generated by referring Ansible doc.  
How can we generate a correctly password for Aix machine? Thank a lot.

Thanks  
Ray Tan

---

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [May 23, 2018, 12:02pm UTC](https://forum.ansible.com/t/cant-login-aix-machine-by-the-account-that-was-created-by-ansible-user-module/27599/2 "2018-05-23T12:02:33Z")

</div>

> Hello everybody,
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I am using Ansible user module to create Aix machine account. I found  
> that the new created user can't login Aix machine.
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The below is my some test step;  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Generate a crypted password by ansible provided method. The  
> cleartext password is "123456"  
> [http://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module](http://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. Use below command to create a new Aix user successful.  
> ansible 192.168.2.\*\*\* -m "user" -a "state=present name=ray  
> password=$6$PbSwE6eWakaP9VSl$GjZhuR5.6ICTM6K/.91gss2iYbhJoLU1B51XXqxCMIcVi17IMAegxlcfWNfWkuYkldRuKJLw9xjTp/F4.hFYq0"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. Login Aix machine with the new user failed. The reason is error  
> password.
> 
> If we get a crypted password by Aix from /etc/security/passwd, replace the  
> above password that was crypted by ansible doc with the new crypted  
> password. We can login Aix with new account.
> 
> So, the issue reason should be Aix machine can't accept the cryted password  
> that is generated by referring Ansible doc.  
> How can we generate a correctly password for Aix machine? Thank a lot.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Was the user creation successful as far as Ansible was  
concerned? Anything interesting in the AIX box's log file? Did you  
check the /etc/security/passwd file?

---

<div class="post-metadata">

**Author:** ![Werner\_Flamme](https://avatars.discourse-cdn.com/v4/letter/w/c68b51/32.png) [@Werner\_Flamme](https://forum.ansible.com/u/Werner_Flamme)\
**Post date:** [May 23, 2018, 12:24pm UTC](https://forum.ansible.com/t/cant-login-aix-machine-by-the-account-that-was-created-by-ansible-user-module/27599/3 "2018-05-23T12:24:41Z")

</div>

shaolong\_t@hotmail.com [23.05.2018 13:24]:

> Hello everybody,
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I am using Ansible user module to create Aix machine account. I found  
> that the new created user can't login Aix machine.
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The below is my some test step;  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Generate a crypted password by ansible provided method. The  
> cleartext password is "123456"  
> [http://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module](http://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. Use below command to create a new Aix user successful.  
> ansible 192.168.2.\*\*\* -m "user" -a "state=present name=ray  
> password=$6$PbSwE6eWakaP9VSl$GjZhuR5.6ICTM6K/.91gss2iYbhJoLU1B51XXqxCMIcVi17IMAegxlcfWNfWkuYkldRuKJLw9xjTp/F4.hFYq0"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. Login Aix machine with the new user failed. The reason is error  
> password.
> 
> If we get a crypted password by Aix from /etc/security/passwd, replace the  
> above password that was crypted by ansible doc with the new crypted  
> password. We can login Aix with new account.
> 
> So, the issue reason should be Aix machine can't accept the cryted password  
> that is generated by referring Ansible doc.  
> How can we generate a correctly password for Aix machine? Thank a lot.

Currently, you use the SHA512 algorithm to create a password, this is  
recognized by $6$ at the beginning of the string.

When you create a user manually, how does the password string look like?

$1$ -\> crypt; $2$, $2a$, $2y$ -\> blowfish; $5$ -\> sha256, $6$ -\> sha512

Maybe your AIX does not support sha512 passwords, so you must look at  
the hashing that is possible. If you create a user locally and the  
password starts with $2y$, you have to create the ansible password with  
blowfish algorithm instead of sha512.

HTH, Werner

---

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [May 23, 2018, 12:38pm UTC](https://forum.ansible.com/t/cant-login-aix-machine-by-the-account-that-was-created-by-ansible-user-module/27599/4 "2018-05-23T12:38:34Z")

</div>

> shaolong\_t@hotmail.com [23.05.2018 13:24]:
> 
> > Hello everybody,
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I am using Ansible user module to create Aix machine account. I found  
> > that the new created user can't login Aix machine.
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The below is my some test step;  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Generate a crypted password by ansible provided method. The  
> > cleartext password is "123456"  
> > [http://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module](http://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. Use below command to create a new Aix user successful.  
> > ansible 192.168.2.\*\*\* -m "user" -a "state=present name=ray  
> > password=$6$PbSwE6eWakaP9VSl$GjZhuR5.6ICTM6K/.91gss2iYbhJoLU1B51XXqxCMIcVi17IMAegxlcfWNfWkuYkldRuKJLw9xjTp/F4.hFYq0"  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. Login Aix machine with the new user failed. The reason is error  
> > password.
> > 
> > If we get a crypted password by Aix from /etc/security/passwd, replace the  
> > above password that was crypted by ansible doc with the new crypted  
> > password. We can login Aix with new account.
> > 
> > So, the issue reason should be Aix machine can't accept the cryted password  
> > that is generated by referring Ansible doc.  
> > How can we generate a correctly password for Aix machine? Thank a lot.
> 
> Currently, you use the SHA512 algorithm to create a password, this is  
> recognized by $6$ at the beginning of the string.
> 
> When you create a user manually, how does the password string look like?
> 
> $1$ -\> crypt; $2$, $2a$, $2y$ -\> blowfish; $5$ -\> sha256, $6$ -\> sha512
> 
> Maybe your AIX does not support sha512 passwords, so you must look at  
> the hashing that is possible. If you create a user locally and the  
> password starts with $2y$, you have to create the ansible password with  
> blowfish algorithm instead of sha512.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I always assume the OS will use the strongest encryption on the  
root pw, which is why I was suggesting to look again at  
/etc/security/passwd. Then try whatever it used for root.

---

<div class="post-metadata">

**Author:** ![shaolong\_t](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shaolong\_t](https://forum.ansible.com/u/shaolong_t)\
**Post date:** [May 24, 2018, 1:52am UTC](https://forum.ansible.com/t/cant-login-aix-machine-by-the-account-that-was-created-by-ansible-user-module/27599/5 "2018-05-24T01:52:46Z")

</div>

Thanks Werner for your quickly response,

I manual create a new user “raytest” and set password to “123456”. I don’t find the crypted password of the new user match the format that you mention. Do you help find the crypt method? Thanks.

The below is the crypted password string in /etc/security/passwd file.

raytest:  
password = bo8Dqpvt3wnb.  
lastupdate = 1527172932  
flags = ADMCHG

Thanks  
Ray

在 2018年5月23日星期三 UTC+8下午8:24:54，Werner Flamme写道：

---

<div class="post-metadata">

**Author:** ![shaolong\_t](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shaolong\_t](https://forum.ansible.com/u/shaolong_t)\
**Post date:** [May 24, 2018, 2:13am UTC](https://forum.ansible.com/t/cant-login-aix-machine-by-the-account-that-was-created-by-ansible-user-module/27599/6 "2018-05-24T02:13:06Z")

</div>

Thanks Mauricio for your quickly response,

I sure the user is created successful, because I can grep the user name from /etc/passwd. Also, I can transfer the user successful from root by “su \*\*\* -” command.

I checked the /etc/security/passwd, I can see the origin crypted password in the file. Please see below the password of new user and root.

root:  
password = j7SpMBcZZRZq6  
lastupdate = 1524597968

ray:  
password = $6$PbSwE6eWakaP9VSl$GjZhuR5.6ICTM6K/.91gss2iYbhJoLU1B51XXqxCMIcVi17IMAegxlcfWNfWkuYkldRuKJLw9xjTp/F4.hFYq0  
lastupdate = 1527116053

If any log files can help check the issue, please let me know. I will check them. Thanks you very much.

Thanks  
Ray

在 2018年5月23日星期三 UTC+8下午8:02:48，Mauricio Tavares写道：

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [May 24, 2018, 5:55am UTC](https://forum.ansible.com/t/cant-login-aix-machine-by-the-account-that-was-created-by-ansible-user-module/27599/7 "2018-05-24T05:55:41Z")

</div>

It's using the inferior des and not sha-512

$ echo 123456 | mkpasswd -m des -S bo -s  
bo8Dqpvt3wnb.

---

<div class="post-metadata">

**Author:** ![shaolong\_t](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shaolong\_t](https://forum.ansible.com/u/shaolong_t)\
**Post date:** [May 24, 2018, 9:27am UTC](https://forum.ansible.com/t/cant-login-aix-machine-by-the-account-that-was-created-by-ansible-user-module/27599/8 "2018-05-24T09:27:02Z")

</div>

Thanks Kai very much. It work for me.

Thanks  
Ray

在 2018年5月24日星期四 UTC+8下午1:55:54，Kai Stian Olstad写道：
