Mail Administration Guide

How to Create and Populate /etc/shells

This file is not included in the standard release, so it must be added if users are to be allowed to use .forward files to forward mail to a program or to a file. It is possible to create the file by hand by using grep to identify all of the shells listed in your password file, then entering them manually in the file, but it is easier to use the procedure below, which employes a script that can be downloaded.

  1. Download the script from http://www.sendmail.org/sun-specific/gen-etc-shells.html.

  2. Become root.

  3. To generate a list of shells, run the gen-etc-shells script.


    # ./gen-etc-shells.sh > /tmp/shells
    

    This script uses the getent command to collect the names of shells included in the password file sources listed in /etc/nsswitch.conf.

  4. Inspect the list of shells in /tmp/shells.

    Using the editor of your choice, remove any shells that you do not want included.

  5. Move the file to /etc/shells.


    # mv /tmp/shells /etc/shells