What is the purpose of the /etc/shadow file in Linux Operating system? Also, is it same for SUSE clients? There is one shadow cache file is maintained what is purpose of that?
migrated from stackoverflow.com Feb 6 '11 at 13:21
From the beginning, Unix and Unix-style operating systems (including Linux) have always stored passwords as cryptographic hashes. These hashes were originally stored in
To prevent this, the hashed passwords were eventually moved into a file readable only by root (and occasionally a privileged group of administrators),
 Pedantic, I know, but the stored passwords are not encrypted. They are hashed using a cryptographically-secure (at least as of the time it was written) hashing algorithm. The primary distinctions relevant here are that hashes are fixed-length (the length of encrypted text varies based on the length of the text which was encrypted) and non-reversible (encrypted text can be decrypted; hashed text cannot).
 Because hashes are fixed-length, there are an infinite number of inputs which will match any given hashed representation. An attacker could, therefore, find a working password which is not necessarily the same as the owning user's password - although this is very unlikely given the size of modern crypto hashes.
Originally, the encrypted password was stored in
But then people realized that this was a security problem. Anybody with enough time could do what's called a bruteforce attack, by programatically generating encrypted passwords for every possible password. If the attacker did that without actually trying to log in via
So the encrypted password was moved into the newly created
It also contains other information that the
I can't say whether it is the same for SUSE, without knowing which version of SUSE you are dealing with. For example, your SUSE system may use Blowfish rather than MD5.
You also implied you were mixing your
See Problems migrating shadow file from SuSE 9.3 to Ubuntu Server x86_64 for example.
To try to figure it out, open up
If you are using Ubuntu, the first Google search result for Ubuntu blowfish might be a good starting place.
Users are listed in the
Each line corresponds to a user entry and different fields are separated by colons. The first filed is the login, it is followed by the corresponding password.
Encrypted passwords used to be stored in this field. However, the