6. The TERM environment, if it has been set, is preserved.
7. The HOME, PATH, SHELL, TERM, MAIL, and LOGNAME environment variables are set. (If the
-p option is used, all preexisting environmental variables are preserved.)
8. The PATH defaults to /usr/local/bin:/bin:/usr/bin: for normal users and to
/sbin:/bin:/usr/sbin:/usr/bin for root.
9. Normal greeting messages and mail checking are disabled if the file .hushlogin
exists in the users’ home directory; otherwise, those messages display at the end of
the logon process.
10. The user’s command shell is started at this point, presenting the user with a
command prompt. If no shell is specified for the user in
/etc/passwd, /bin/sh is
used by default. (Some UNIX operating systems will just log you back out.) If no
home directory is specified in
/etc/passwd, / is used.
When you log in as a regular user, the files that control your environment are found in
/home/username directory. These configuration files are normally hidden from view
because their filename is preceded by a period (as in
.bashrc—these are known as dot
The name of the file indicates which program it is associated with. The files
logout, .bash_profile, and .bashrc all determine how the bash shell is used by the user.
(These files can, of course, be preset by the system administrator with the user given only
read access, so the files cannot be changed. Other shells have their own associated files.)
Other files might be present depending on the system and the system administrator. The
point is that the environment of each user can be set globally through the use of files in
/etc/skel and individually by allowing user modification of the files in their /home direc-
tory (or not, depending on the system administration policies).
The system logs all user logins, as well as all uses of
su and sudo commands for the sysad-
min’s review. (The
init, syslogd, and klogd applications create the logs.) Modern secu-
rity-monitoring programs (or simple scripts you create) can scan these files (such as
/var/log/messages) for anomalies and signal possible security violations.
On large systems with many users, you need to control the amount of disk space a user
has access to. Disk quotas are designed for this purpose. Quotas, managed per each parti-
tion, can be set for both individual users as well as groups; quotas for the group need not
be as large as the aggregate quotas for the individuals in the groups.