CentOS default is configured to use MD5 hashing algorithm to encrypt user passwords. This function is not even close the safest, in fact there are programs for brute-force md5 encrypted keys. An example is John the Ripper .
To find out which algorithm is being used you can use the authconfig command.
[root @ trombotic ~] # authconfig - test : 14930:0:99999:7:::
usersha256:
$ 5 $ 1SSWI1VP $ SGx7ldgHLghTCCln39MOZIM277BX3VKtHgFDpnWXUAB : 14930:0:99999:7:::
usersha512: $ 6 $ rOmZT0Eu
$ ho7SvCwlIVeojtKzow7jIUa2IKiVoVmM0EJ.KvrHPcBx3h6mEL.8f9Rlz .e072v/28mWPGIABQ.gg.II8bMY.0
: 14930:0:99999:7:::
a user key is encrypted with md5, the second and the third sha256 sha512. By the way, no need you to try to decipher the encrypted password is 123456. This also may know that the password begin with the identifier of the algorithm they use:
md5 $ 1 $ is $ 5 $ is sha256
$ 6 $ is sha512 To change the algorithm used, we also use the authconfig command. For example, to sha256:
authconfig - passalgo = sha256 - update
- To sha512:
- authconfig - passalgo = sha512 - update
- To return md5:
authconfig - -passalgo = md5 - update
must have one thing in mind, when you change the hash function only new keys made from the change use the new hash function. Those already in the system are using the above function. For all the keys are encrypted with the new feature can force users to change your password the next time they enter the system. To achieve this, you can change the expiration date of the password with the command chage:
chage-d 0 usermd5
chage-d 0 usersha256
0 comments:
Post a Comment