Home arrow Site Administration arrow Page 3 - Managing Users Part 1

Shells, Startup Scripts and Mail - Administration

This first part of chapter 5 "Module 5: Managing Users" covers understanding user properties and user databases. It also examines the technique of managing users for a single host. It starts by exploring the actual database files that contain information about users and moves on to the system tools available to manage the files automatically. (from the book Linux Administration, A Beginner's Guide, third edition by Steven Graham and Steve Shah, McGraw-Hill/Osborne, ISBN:0072225629, 2002).

  1. Managing Users Part 1
  2. Critical Skill 1 - Understand User Properites
  3. Shells, Startup Scripts and Mail
  4. Critical Skill 2 - Understand the User Databases
  5. The /etc/shadow File and The /etc/group File
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 7
June 23, 2004

print this article



When users log in to the system, they expect an environment that can help them be productive. This first program that users encounter is called a shell. If you’re used to the Windows side of the world, you might equate this to command.com, Program Manager, or Windows Explorer (not to be confused with Internet Explorer, which is a Web browser).

Under UNIX, most shells are text based. The shell we discuss in further detail in Module 6 is the default shell for the root user, the Bourne Again Shell, or BASH for short. Linux comes with several shells from which to choose—you can see most of them listed in the /etc/shells file. Deciding which shell is right for you is kind of like choosing a favorite beer—what’s right for you isn’t right for everyone, but, still, everyone tends to get defensive about his or her choice!

What makes UNIX so interesting is that you do not have to stick with the list of shells provided in /etc/shells. In the strictest of definitions, the password entry for each user doesn’t list what shell to run so much as it lists what program to run first for the user. Of course, most users prefer that the first program run be a shell, such as BASH.

Startup Scripts

Under DOS, you are used to having the autoexec.bat and config.sys files run automatically when you start up the system. Since DOS is a single-user system, the two programs not only perform system functions such as loading device drivers, but they also set up your working environment.

UNIX, on the other hand, is a multiuser environment. Each user is allowed to have their own configuration files; thus, the system appears to be customized for each particular user, even if other people are logged in at the same time. The configuration file comes in the form of shell script—a series of commands executed by the shell that starts when a user logs in. In the case of BASH, it’s the file .bashrc. (Yes, there is a period in front of the filename—filenames preceded by periods, also called dot files, are hidden from normal directory listings unless the user uses a special option to list them.) You can think of shell scripts in the same light as batch files, except shell scripts can be much more capable. The .bashrc script in particular is similar in nature to that of autoexec.bat.

Most Linux/Unix software likes to store information in directories or files that begin with a . in your home directory. Some examples are .netscape and .kde. Also, there are several files that contain customizable options for some of your favorite applications:

  •  .emacs The configuration file for emacs; venture into this when you would like to start learning Lisp.
  • .bashrc/.profile Configuration files for BASH.
  • .tcshrc/.login Configuration files for tcsh.
  • .xinitrc This script overrides the default script that gets called when you log in to the X Window System.
  • .Xdefaults This file contains defaults that you can specify for X Window System applications.

To see all of the files in your home directory, simply type ls -al.

When you create a user’s account, you should provide a default set of dot files to get the user started. If you use the tools that come with Linux, you don’t need to worry about creating these files—the tools automatically do this for you. However, there is nothing stopping you from customizing these files to make them site specific. For example, if you have a special application that requires an environment variable to be set, you can add that to the dot files that are copied to the new user’s home directories.


Creating a new user means not only creating the user’s home directory and setting up the environment, it also means making it possible for the user to send and receive e-mail. Setting up a mailbox under Linux is quite easy, and if you use the tools that come with Linux to create the account, you don’t even have to do this yourself!

Mailboxes are kept in the /var/spool/mail directory. Each user has a mailbox that is based on their login name. Thus, if a user’s login is jyom, their mailbox will be /var/spool/mail/jyom. All mailboxes should be owned by their respective owners with the permissions set so that others cannot read its contents. (See the chown, chmod, and chgrp commands in Module 6 for details on how to do this.)

An empty mailbox is a zero-length file. To create a zero-length file anywhere in the system, you simply use the touch command, like so:

[root@ford /root]# touch myfile

This will create a new file called myfile in the current directory.

This chapter is from Linux Administration, A Beginner's Guide, third edition, by Graham and Shah. (McGraw-Hill/Osborne, 2002, ISBN: 0072225629). Check it out at your favorite bookstore today. Buy this book now.

>>> More Site Administration Articles          >>> More By McGraw-Hill/Osborne

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates


Dev Shed Tutorial Topics: