System Administration Guide: Network Services

ProcedureHow to Create and Populate /etc/shells

This file is not included in the standard release. You must add the file if users are to be allowed to use .forward files to forward mail to a program or to a file. You can create the file manually by using grep to identify all of the shells that are listed in your password file. You can then type the shells into the file. However, the following procedure, which employs a script that can be downloaded, is easier to use.

  1. Download the script.

    http://www.sendmail.org/vendor/sun/gen-etc-shells.html

  2. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  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 that are included in the password file sources that are listed in /etc/nsswitch.conf.

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

    With the editor of your choice, remove any shells that you are not including.

  5. Move the file to /etc/shells.


    # mv /tmp/shells /etc/shells