UNIX Hints & Hacks

ContentsIndex

Chapter 5: Account Management

 

Previous ChapterNext Chapter

Sections in this Chapter:

   

5.1 User Account Names

 

5.5 GECOS Field

 

5.9 User Account Startup Files

 

5.13 Finding My Display

5.2 Passwords

 

5.6 Home Directories

 

5.10 Using Aliases

 

5.14 Copy Files to Multiple Home Directories

5.3 UID

 

5.7 Shells and the Password File

 

5.11 MS-DOS Users

 

5.15 Kill an Account

5.4 Group IDs and /etc/group

 

5.8 Configuring an Account

 

5.12 Changing Shells

 

5.16 Nulling the Root Password Without vi

 

5.9 User Account Startup Files

5.9.1 Description

5.9.1 Description

After the login process begins, certain startup files are processed (depending on the login shell that is selected).

Flavors: AT&T, BSD

Shells: ksh, sh

When the Bourne shell is used, the .profile startup file is processed. This file contains all information and settings for the terminal settings, the environment variables, path, and other general settings.

Shell: csh

The C shell uses two separate startup files and a logout file. The .login file sets up all the necessary terminal characteristics along with the environment variables. The .cshrc file sets the path that commands search, global variables (applications, history, and prompt), the umask value, and the user's personal aliases. When the logout process begins, the .logout file is processed. Entries in this file generally clear the screen, send reminder messages, and can run any scripts on leaving the system.

Other shells make use of the similar features. The tcsh shell uses .tcshrc, and bash uses .bashrc to configure all the user control settings. Many of the startup files end in the letters rc (run command), containing a series of commands that are run at the startup of a shell.

Reason

Startup files are important to every shell that runs. They set the terminal settings and environment variables so the window manager knows what to do. Without proper startup files, programs might never be located because there is no path to them.

Real World Experience

I typically set up two sets of startup files for each environment I work in, and store them in /usr/local/etc. One set is the generic system startups that can be found in the root directory on any flavor. It is the startup files that the account root uses. These are raw untouched startup files that are compatible for anyone to use. When a new user gets an account, I copy duplicates of these files into his or her home directory.

The second set of startup files is customized for the individual environment, not the individual user. These files contain special variable definitions for software licenses, applications, custom path definitions, and aliases that pertain directly to a set of users. An entry is usually made near the bottom of their generic startup files to reference (or source) the customized files.

When this is finished, if a user modifies the startup files on her own to personalize them, she is encouraged to start at the bottom of the files. When the phone rings and the user cannot log in to her account, you can easily comment out her additions and discover what entry is preventing the user from logging into the system.

Other Resources

Man pages:

bash, csh, ksh, sh, tcsh

UNIX Hints & Hacks

ContentsIndex

Chapter 5: Account Management

 

Previous ChapterNext Chapter

Sections in this Chapter:

   

5.1 User Account Names

 

5.5 GECOS Field

 

5.9 User Account Startup Files

 

5.13 Finding My Display

5.2 Passwords

 

5.6 Home Directories

 

5.10 Using Aliases

 

5.14 Copy Files to Multiple Home Directories

5.3 UID

 

5.7 Shells and the Password File

 

5.11 MS-DOS Users

 

5.15 Kill an Account

5.4 Group IDs and /etc/group

 

5.8 Configuring an Account

 

5.12 Changing Shells

 

5.16 Nulling the Root Password Without vi

 

© Copyright Macmillan USA. All rights reserved.