On Wed, Feb 05, 2014 at 09:48:59AM -0800, zerozerouno...@gmail.com wrote: > I needed a "user" puppet resource to add a user and set its password, on > CentOS 6.4. > The manifest was applied with no errors, but the password was not set > correctly. > > I tried: > > password => sha1("password") > > and some hash was set for the user password, but it was not the right one, > I could not log in.
I think that wouldn't work because it doesn't create a salt or the proper format in /etc/shadow of $<pwtype>$salt$hash. > I then tried directly setting the hash I got from "openssl passwd -1 > password": > > password => "$1$RCxCmL.x$MRHrLKqYpha19ERGC/5FQ/" > > but only part of the hash ended up in /etc/shadow, e.g. in this case > ".x/5FQ/". Use single quotes rather than double quotes so the $ aren't interpolated as variables: password => '$1$RCxCmL.x$MRHrLKqYpha19ERGC/5FQ/' > PS: what's the problem with sha1()? I don't care about the password being > in clear text in the manifest, BTW. It just creates a raw SHA1 hash without the required format including the hash type field and salt field. -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20140205182552.GB15505%40angus.ind.WPI.EDU. For more options, visit https://groups.google.com/groups/opt_out.