etc-shadow

Matthew Miller mattdm at fedoraproject.org
Sun Feb 22 06:58:55 UTC 2015


On Sat, Feb 21, 2015 at 06:07:18PM -0700, Chris Murphy wrote:
> I read this:
> http://www.aychedee.com/2012/03/14/etc_shadow-password-hash-formats/
> But Fedora doesn't have mkpasswd by default, whereas passwd seems to
> only update shadow rather than outputting to stdout. And if there's a
> salt used I can't tell how that would be referenced.

It's generated by the crypt function in glibc — man 3 crypt, and scroll
down to the "Glibc notes" section. Although I didn't dig further, that
says that the characters in the resulting string are drawn from the set
[a-zA-Z0-9./]; I assume that it's the same number as would be found in
a sha512sum hash, except mapped to that instead of represented as a
long hexadecimal number. (If you do want to dig further, I suppose
sha512-crypt.c is the place to look.)

If you want to generate such a string yourself, using the crypt
function seems like the easiest way (of course using the python crypt
module or whatever). 
-- 
Matthew Miller
<mattdm at fedoraproject.org>
Fedora Project Leader


More information about the users mailing list