Ask Your Question
0

create password for user

asked 2015-05-06 04:35:14 -0500

paragdj gravatar image

Hi,

I am trying to create a password for a user that is being created by Puppet. I generate a sha512sum for the password and use that value in the resource attribute

user {"dang": home => "/home/dang", shell => "/bin/bash", password => " Long script generated by SHA512sum", }

when i try to login as Dang the password is not accepted. What am i doing wrong. ?

Thanks Parag Daulatjada

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-05-06 12:32:27 -0500

JohnsonEarls gravatar image

updated 2015-05-06 12:34:44 -0500

A sha512 password is not just a sha512 hash of the password. It's a combinatorial hash of the password with a "salt", iterated a large number of times, and has a specific format so it can be recognized: A $6$ followed by the "salt", another $, and the result of the combinatorial hash in base64 encoding.

If your system has /sbin/grub-crypt, try running that to generate your encrypted password:

$ /sbin/grub-crypt --sha-512
Password:
Retype password:
$6$rxDYBGDQT/d9fBuc$xQq7qkgLgSh2WR2D8ska9V51fHtZCj9xvHnfz.o8vYebRUSmKAVbg3QFH5RkThPfP4MjLNY9wbhLhmz.bsNUf0
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2015-05-06 04:35:14 -0500

Seen: 1,102 times

Last updated: May 06 '15