Is there a specific location where the passwords are stored ?
Is it depending on which version is used ?
Are they salted ?
Is there a specific location where the passwords are stored ?
Is it depending on which version is used ?
Are they salted ?
Linux passwords are stored in the /etc/shadow
file. They are salted and the algorithm being used depends on the particular distribution and is configurable.
From what I recall, the algorithms supported are MD5
, Blowfish
, SHA256
and SHA512
. Most recent distributions should be on SHA512
by default if my memory serves me right.
Passwords in unix were originally stored in /etc/passwd
(which is world-readable), but then moved to /etc/shadow
(and backed up in /etc/shadow-
) which can only be read by root (or members of the shadow group).
The password are salted and hashed. The default formats are MD5-crypt, bcrypt, sha256-crypt, sha512-crypt, and for historical reasons DES (note DES only allows 8-byte passwords). Note, sha512-crypt is typically involves 5000 rounds of SHA512-ing the password and the number of rounds is configurable.
For more info consult man crypt
, man shadow
, man passwd
.