How to create shadow pasword hash manually?
How to create the password hash exactly the same as in shadow file (from the command line)?
The command openssl passwd -crypt returns something different. |
Looking for this ??
http://www.linuxquestions.org/questi...d-hash-602739/ |
Quote:
|
I found that $6 means SHA encryption, but then I can't find "salt" option in "openssl sha" command...
|
The following command worked:
python -c "import crypt, getpass, pwd; print crypt.crypt('<PASSWORD>', '\$6\$<SALT>\$')" |
Does anyone know, how SALT is integrated into password?
I have failed to implement encoding myself with the following sequence: 1) concatenate password + salt 2) convert to ASCII bytes 3) perform SHA512 hashing 4) create base64 string I think salt concatenating is somehow wrong... |
The pwdutils package should supply the mkpasswd program.
The results of "mkpasswd -S <salt_string> -m sha-512" is an 86 digit long string, after the type and salt. echo -n 'ThisIsATest' | /usr/bin/mkpasswd -m sha-512 -S 'salt1234' - $6$salt1234$GCfgodngkLAgi8qKn2jCRmzXVF.ZSxa3Pj3bWQJpcxFU.6/YFfwB4LQl26rrs7/nCXTul.6nqDclAp/ki4Jz40 Some distro's use the blowfish hash by default (see man 3 crypt) however, I don't believe that mkpasswd supports blowfish. |
All times are GMT -5. The time now is 12:19 PM. |