Passwords are stored in a database.
To verify that your login name and password are correct, the computer searches for your login name in a password database. This database is kept either in a file called /etc/passwd on your system, or in a systemwide database maintained elsewhere on your network.
Today, many modern UNIX systems don’t use /etc/passwd. Instead, they use something called Network Information Services (NIS), also known as Yellow Pages . The idea behind NIS is that it helps you maintain the same login names and passwords across several different machines. If you have more than one UNIX system on the same network, then it’s likely that you want a login account on all of the machines. In addition, you want to make sure that if you change your password on one machine, it is changed on all other machines as well.
To see your entry in the database, first try running ypmatch name passwd. For example:
% ypmatch lois passwd lois:ctA433xqXp/Q:183:100:Lois Lane:/home/lois:/bin/csh
If you get the message “Command not found,” “no such map in server’s domain,” or “ypbind is not running on this machine,” then use the grep command to search for your name in /etc/passwd:
% grep lois /etc/passwd lois:ctA433xqXp/Q:183:100:Lois Lane:/home/lois:/bin/csh
The fields in a passwd entry are separated by colons. There are usually seven fields in all. The user’s login name is shown in the first field, followed by a colon. The next field shows her password, in an encrypted format. It is encrypted so ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access