Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

ahmad:$1$oYINSKjP$eCkCtJV/2dXerAD57WQPj/:15425:0:99999:7:::

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?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

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))

share|improve this answer
    
Thanks. Now how can I hash X into $id$salt$encrypted on the command line? –  ahmad Dec 5 '12 at 12:43
3  
openssl passwd -1 -salt salt password –  otokan Dec 5 '12 at 12:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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