Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Where does Ubuntu keep the password salt for each user?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

From the manual page of shadow(5):

Each line of this file contains 9 fields, separated by colons (“:”), in the following order:

[..] encrypted password
Refer to crypt(3) for details on how this string is interpreted.

Alright, let's have a look at man 3 crypt then. From the notes section:

[..] So $5$salt$encrypted is an SHA-256 encoded password and $6$salt$encrypted is an SHA-512 encoded one.

"salt" stands for the up to 16 characters following "$id$" in the salt. The encrypted part of the password string is the actual computed password.

So, the salt is stored in the password field of /etc/shadow itself. For more details, have a look at the manual page of crypt(3).

share|improve this answer

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.