Can't set user password

560 views
Skip to first unread message

Martin Supiot

unread,
Jun 4, 2014, 6:51:45 AM6/4/14
to puppet...@googlegroups.com
Hi!

I try to set a user password. I do :

vagrant@db:~$ sudo puppet apply -e "user { 'martin': name => 'martin', ensure => 'present', password => '$6$salt$RheJLXa4oI89Bob98PelI2w1l7.StNxtasDd0hBJbGUrSahnzsSf3rZ8.CoT9CoTNd/6qyaieI7lunITBZaRP1'}"
Notice: Compiled catalog for db in environment production in 0.06 seconds
Notice: /Stage[main]/Main/User[martin]/password: changed password
Notice: Finished catalog run in 0.06 seconds
vagrant@db:~$ su martin
Password:
su: Authentication failure

I can't authenticate. If I check the password, I see it truncated ...

vagrant@db:~$ sudo cat /etc/shadow |grep ^martin
martin:.StNxtasDd0hBJbGUrSahnzsSf3rZ8.CoT9CoTNd/6qyaieI7lunITBZaRP1:16225:0:99999:7:::

If I try to change it in cli, it's ok

vagrant@db:~$ passwd martin
passwd: You may not view or modify password information for martin.
vagrant@db:~$ sudo passwd martin
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
vagrant@db:~$ sudo cat /etc/shadow |grep ^martin
martin:$6$iH/04P.R$oPNMDpgNrS2glZLrBdoo15w76Z77DK9ywcyllrgakcDg32GKUjyfRGTfHcNvd8rNpOC2b.C3p9xssF9mwN7iI/:16225:0:99999:7:::

I can connect !

vagrant@db:~$ su martin
Password:
martin@db:/home/vagrant$ exit

I'm on a ubuntu 14.04 with ruby-shadows package installed. Any idea ?

Thanks

José Luis Ledesma

unread,
Jun 4, 2014, 9:37:05 AM6/4/14
to puppet...@googlegroups.com

Hi,

Put the user declaration in a file, or use ' instead of " ( then you'll have to escape all ' )

The problem is that you are using ", so the shell is interpreting $6 and $salt as empty variables.

Regards

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c148873e-43b0-4aca-ac8d-fb9b5b18333f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages