I've changed my password to X and the shadow file has changed to:


I see the encrypted X as $1$oYINSKjP$eCkCtJV/2dXerAD57WQPj/. How can I retrieve the encrypted X without changing the password? openssl or any other command to use?


Your password isn't encrypted. It is hashed.

A salted MD5 hash has been generated and written to /etc/shadow. You cannot retrieve original value.

The original value X has been hashed in this format: $id$salt$encrypted - id == 1 stands for MD5 (see NOTES on manpage of crypt(3))

  • Thanks. Now how can I hash X into $id$salt$encrypted on the command line? – lashgar Dec 5 '12 at 12:43
  • 4
    openssl passwd -1 -salt salt password – otokan Dec 5 '12 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.