Shadow Password Files Keep the Check Separate
A shadow password file stores password-verification information where ordinary users aren't allowed to read it. On Linux systems using this arrangement, /etc/shadow holds that restricted data, while /etc/passwd contains account information other software needs to consult.
The separation solves a practical problem. Software needs to translate a numerical user identifier into an account name. That doesn't mean every program or local user should also receive the material used to check that account's password.
The Linux passwd manual explains why ordinary account records are readable. On a system using shadow passwords, an x in the password field points to separate password information in /etc/shadow. It isn't the user's password.
- Finally understand what the commands you type are doing behind the scenes.
- Fix problems yourself instead of pasting in fixes you found online and hoping.
- Go from following tutorials to knowing why they work, one clear chapter at a time.
The saved value is for comparison
A password-checking system can store a hash: a calculated value produced from the password and other inputs. At sign-in, it calculates a result from the supplied password and compares that result with the saved one.
A salt is an additional value used in that calculation. Separate salts make one set of precomputed guesses less reusable across different password records. The hashing method can also require more computing work for each attempt, making repeated guesses more expensive.
This isn't the same as encrypting a password so it can later be decrypted. Some legacy manuals label the field “encrypted password,” but the Linux crypt manual explicitly describes password hashing.
The distinction matters after theft. An attacker doesn't have to decrypt the original password. They can try guesses and compare the calculated results with the stolen verifier—the stored information used to check whether a password is right.
The file holds more than password hashes
The Linux shadow format contains nine fields separated by colons. Alongside the login name and password field, it can hold information about the last password change, password aging rules that limit how long a password may remain in use, and expiration.
These values describe account or password conditions. They aren't a running history of failed login attempts. A shadow file isn't an audit log of everyone who tried to sign in.
Its password field can also contain a lock marker. A leading exclamation mark prevents signing in with the stored password. That does not necessarily disable every other login method the system permits.
The shadow file manual makes this distinction explicit. “Password locked” and “no possible access to the account” aren't interchangeable conclusions.
These details describe the Linux shadow-utils format. Other Unix-like systems needn't store the same information in exactly the same layout.
The Database Mistake That Puts Every Password at Risk
Two protections, two different jobs
Restricted file access keeps ordinary users from routinely obtaining password verifiers. Hashing avoids keeping the original passwords as readable text. Neither makes a stolen file harmless.
Someone who copies the verifier data can attempt offline guessing, meaning the attempts happen on the attacker's own system. The real sign-in service doesn't receive each guess. The OWASP password-storage guidance explains why salts and appropriate hashing costs matter in that situation.
The difficulty of guessing those passwords depends on the passwords and the storage method, not simply on the filename.
Password Cracking: How Guesses Work Against a Stolen Database

Work Factor: Making Each Password Guess Cost More

What Is Salting in Password Security and How Does It Work?

QUOTE:
"Amateurs hack systems, professionals hack people."
