The /etc/passwd file

Login Names

Things to consider:

Encrypted Passwords

Things to consider: Shadow password support is now fairly common on Unix. The idea is to remove the encrypted passwords from the /etc/passwd file and store them in a file that doesn't allow world:read access. Shadow passwords are stored in the file /etc/shadow. The shadow password file can be created with the command pwconv. This will extract the passwords from the password file and create the /stc/shadow file.

Shadow passwords work on a single system but don't offer much protection in a NIS environment. In that environment somethng like kerberos is a better tool at protecting passwords. We will discuss this when we review security.

UID

The UID is used by the file system to control who owns a file and who has access to a file. The UID value of 0 is consider a special value and signifies the account holder should have unrestricted access to the system. Since UID's control access to files and determine ownership it is best to assign each person a unique UID value. Things to consider include:

Group ID (GID)

The group field controls group ownership and access to files.The group ID in the password file is the default group to use for ownership of files.

The Gecos field

The gecos field takes it's name from an old batch operating system. It's function is to provide some demographic information about the account. The finger command uses this field to display information about the user specified. In order for the finger command to properly display the information the field uses commas to seperate the information. Finger assumes the following format:
fullname, Office Location, Office Phone, Home Phone

If a field is missing just leave it empty and use the comma to move to the next field.

To change this value Berkeley systems offer the chfn command. Systems running NIS can use the ypchpass command to update the information on themselves. If you are using this field to keep demographic info on users then you may want to disable the commands that allow updates.

Home Directory

This is your default directory when you log in. Some systems will not allow you to log in if your home directory is not present. This is a nice feature, without this the users are placed in the root directory. While this isn't (shouldn't) a security problem it will create confusion when the user finds many utilities don't work.

Naming strategy for directorys depend on the number of accounts and size of filesystems. Your best bet is to create a strategy that allow flexibility down the road. We will discuss this later when we review NFS.

Shell

This is the command interpreter to use for your account. General choices are /bin/csh, /bin/ksh, and /bin/sh. In addition, other choices include /bin/tcsh and /bin/bash. Many systems limit the shells you can use to those listed in the file /etc/shells.

One useful feature for the shell field is creating a shell script that notifies someone their account has been disabled.