One Day Sec

How are Linux user passwords stored and what is the format in the /etc/shadow file?

Linux user passwords are encrypted and stored in the `/etc/shadow` file, which is only readable by root. Each hash follows the format `$id$salt$encrypted`, where `id` indicates the algorithm (1=MD5, 5=SHA-256, 6=SHA-512), `salt` is a random value, and `encrypted` is the salted hash. The `/etc/passwd` file stores other user info but uses an `x` to indicate the password is in shadow. For a detailed breakdown of all fields, see the Linux Password Hashes article.
/etc/shadowpassword hash formatsaltMD5SHA-256SHA-512Linux password storage

Browse all Q&A →