- Shadow password
In
computing ,Unix-like operating systems use the shadow password database mechanism to increase the security level of passwords by preventing ordinary users from accessing encrypted password data.Unshadowed passwords
On a system without shadowed passwords (typically very old Unix machines), the passwd database holds the following user information:
* Username
* Salt and hashed password
* Password expiration information
* User ID (UID)
* Default group ID (GID)
* Full name
*Home directory path
* Login shellThe passwd file is readable by all users in order to allow name service switch to work (eg, to ensure that user names are shown when the users lists the contents of a folder), but only
root can write to it. This means that an attacker with access to the system at normal privilege level can obtain the hashed form of every user's password. These can then be used to mount abrute force attack offline, using the hashed passwords as a relatively fast way to test guessed passwords without alerting system security modules designed to detect an abnormal number of failed login attempts. Most users select passwords that are vulnerable to suchpassword cracking techniques. [cite news
authorlink =
author = Rob Lemos
coauthors =
title = Passwords: the weakest link?
url = http://www.news.com/2009-1001-916719.html
work =CNET News.com
date = 2002-05-22
accessdate = 2008-02-19]Shadowed passwords
Systems administrators can reduce brute force attacks by making the hashed password unreadable by unprivileged users, and the obvious way to do this is to make the
passwd
database itself readable only by the root user. However, this would also restrict access to other data in the file such as username-to-userid mappings, which would break many functions on the system. Thus the idea of a "shadow" password file was conceived, where thepasswd
file remains world-readable but users' hashed passwords are moved to a separate database - for local files, usually /etc/shadow onLinux and Unix systems or /etc/master.passwd onBSD systems—which can be read only by root. (Root access to the data is considered acceptable since on systems with the traditional "all-powerful root" security model, the root user would be able to obtain this information by other means.) Virtually all modernUnix-like operating systems use shadowed passwords.With shadowed passwords in use, the /etc/passwd file shows a character such as '*', or 'x' instead of the hashed password, and /etc/shadow holds the following user information:
* User login name
* salt and hashed password
* Days since epoch of last password change
* Days until change allowed
* Days before change required
* Days warning for expiration
* Days before account inactive
* Days since Epoch when account expires
* ReservedWhile the most important information in the shadow file consists of the hashed password, the file usually contains other fields as well, such as the last time the password was changed, when the password will expire, and whether the account is disabled. The format of the shadow file is simple and is basically identical to that of the password file: one line per user, ordered fields on each line, and fields separated by colons. Many systems specify that the order of user lines in the shadow file should be identical to the order of the corresponding users in the password file.
To modify the contents of the shadow file, users generally invoke the passwd program, which in turn is largely depending on PAM. For example, the type of hash used is dictated by the configuration of the pam_unix.so module. By default the
MD5 hash is used, while the newer pam_unix2.so module is also capable of stronger hashes such as blowfish.Note that the shadow password file does not entirely solve the problem of access to hashed passwords, as some network authentication schemes operate by transmitting the encrypted password over the network, making it vulnerable to interception. Alternate copies of system data, such as system backups written to tape or optical media, can also become a means for illicitly obtaining hashed passwords. In addition, the functions used by legitimate password-checking programs need to be written in such a way that malicious programs cannot make large numbers of authentication checks at high rates of speed.
History
Password shadowing first appeared in UNIX systems with the development of
System V Release 3.2 in 1988 andBSD 4.3 Reno in 1990. Vendors which had performed ports from earlier UNIX releases did not include the new password shadowing features, leaving users of those systems exposed to password file attacks.In
1987 the author of the original "Shadow Password Suite",Julie Haugh , experienced a computer break-in and wrote the initial release of the Shadow Suite containing just thelogin
,passwd
andsu
commands. The original release, written for the SCOXenix operating system, quickly got ported to other platforms. The Shadow Suite was ported toLinux in1992 one year later from Linux announcement and became a part of many early distributions.System administrators may also arrange for the storage of passwords in distributed databases such as
NIS andLDAP , rather than in plaintext files on each system. In the case of NIS, the shadow password mechanism is often still used on the NIS servers; in other distributed mechanisms the problem of access to the various user authentication components is handled by the security mechanisms of the underlying data repository.See also
*
Key derivation function
*Unix security
*vipw , a utility to edit the password and/or shadow fileExternal links
* [http://linux.die.net/man/8/authconfig authconfig] , a command-line tool for controlling the use of shadow passwords
References
Wikimedia Foundation. 2010.