<?Pub UDT _bookmark _target?><?Pub UDT __target_1 _target?><?Pub UDT registeredtm trademark?><chapter id="userconcept-97366"><?Pub Tag atict:info tracking="on" ref="0"?><?Pub Tag
atict:user user="sk23612" fullname="Juanita Heieck"?><?Pub Tag atict:user
user="jonj" fullname="Juanita Heieck"?><?Pub Tag atict:user user="kathys"
fullname="Kathy Slattery"?><?Pub Tag atict:user user="cathleen" fullname=""?><?Pub Tag
atict:user user="eb151805" fullname="Juanita Heieck"?><?Pub Tag atict:user
user="jh118764" fullname="Juanita Heieck"?><?Pub Tag atict:user user="lh136763"
fullname="Laura Hartman"?><title>Managing User Accounts and Groups (Overview)</title><highlights><para>This chapter provides guidelines and planning information for managing
user accounts and groups. This chapter also includes information about customizing
the user's work environment.</para><itemizedlist><para>This is a list of the overview information in this chapter:</para><listitem><para><olink targetptr="userconcept-9" remap="internal">What's New in Managing Users
and Groups?</olink></para>
</listitem><listitem><para><olink targetptr="userconcept-36940" remap="internal">What Are User Accounts
and Groups?</olink></para>
</listitem><listitem><para><olink targetptr="userconcept-23283" remap="internal">Where User Account and
Group Information Is Stored</olink></para>
</listitem><listitem><para><olink targetptr="userconcept-16910" remap="internal">Tools for Managing User
Accounts and Groups</olink></para>
</listitem><listitem><para><olink targetptr="userconcept-23295" remap="internal">Customizing a User's
Work Environment</olink></para>
</listitem>
</itemizedlist><para>For step-by-step instructions on managing user accounts and groups,
see <olink targetptr="usersetup-92366" remap="internal">Chapter&nbsp;5, Managing User Accounts
and Groups (Tasks)</olink>.</para>
</highlights><sect1 id="userconcept-9"><title>What's New in Managing Users and Groups?</title><para>This section includes information about new or changed features for
managing users and groups in this Solaris release.</para><sect2 id="gdeou"><title><command>useradd</command> Default
Shell Enhancements</title><para>The <command>useradd</command> command enables you to specify a default
shell by using the <option>s</option> option and a default <filename>skel</filename>directory
by using the <option>k </option>option.</para><para>For example:</para><screen># <userinput>useradd  -D  [-s /usr/bin/ksh]  [-k /export/home] foo</userinput> </screen><para>You can now also specify a base directory without using the <option>D</option> option.</para><para>For example:</para><screen># <userinput>useradd [-b /export/home] foo</userinput></screen><para>For more information on these changes, see the <olink targetdoc="refman" targetptr="useradd-1m" remap="external"><citerefentry><refentrytitle>useradd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2>
</sect1><sect1 id="gdepa"><title>Tools for User Account and Group Account Management</title><para>The following table describes available tools for user account and group
management.</para><table frame="topbot" id="gdepk"><title>Tools for User Account and Group Management</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="25*"/><colspec colname="colspec1" colwidth="25*"/><colspec colname="colspec2" colwidth="25*"/><thead><row rowsep="1"><entry><para>Tool Name</para>
</entry><entry><para>Description</para>
</entry><entry><para>For More Information</para>
</entry>
</row>
</thead><tbody><row><entry><para>Solaris Management Console</para>
</entry><entry><para>Graphical tool that is used to manage users, groups, roles, rights,
mailing lists, disks, terminals, and modems.</para>
</entry><entry><para><olink targetptr="usersetup-129" remap="internal">Setting Up User Accounts (Task Map)</olink></para>
</entry>
</row><row><entry><para><command>smuser</command>, <command>smrole</command>, <command>smgroup</command></para>
</entry><entry><para>Commands that are used to manage users, groups and roles. The SMC services
must be running to use these commands.</para>
</entry><entry><para><olink targetptr="usersetup-34" remap="internal">Adding a Group and User With the smgroup
and smuser Commands</olink></para>
</entry>
</row><row><entry><para><command>useradd</command>, <command>groupadd</command>, <command>roleadd</command>; <command>usermod</command>, <command>groupmod</command>, <command>rolemod</command>; <command>userdel</command>, <command>groupdel</command>, <command>roledel</command></para>
</entry><entry><para>Commands that are used to manage users, groups, and roles.</para>
</entry><entry><para><olink targetptr="usersetup-33" remap="internal">Adding a Group and User With the groupadd
and useradd Commands</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><note><para>The Admintool is not available in this Solaris release.</para>
</note>
</sect1><sect1 id="userconcept-36940"><title>What Are User Accounts and Groups?</title><para><indexterm id="userconcept-ix1"><primary>user accounts</primary></indexterm><indexterm id="userconcept-ix2"><primary>user accounts</primary><secondary>description</secondary></indexterm>One basic system administration
task is to set up a user account for each user at a site. A typical user account
includes the information a user needs to log in and use a system, without
having the system's root password. The components of user account information
are described in <olink targetptr="userconcept-11407" remap="internal">User Account Components</olink>. </para><para>When you set up a user account, you can add the user to predefined groups
of users. A typical use of groups is to set up group permissions on a file
and directory, which allows access only to users who are part of that group. </para><para>For example, you might have a directory containing confidential files
that only a few users should be able to access. You could set up a group called <literal>topsecret</literal> that includes the users working on the <literal>topsecret</literal> project.
And, you could set up the <literal>topsecret</literal> files with read permission
for the <literal>topsecret</literal> group. That way, only the users in the <literal>topsecret</literal> group would be able to read the files.</para><para>A special type of user account, called a <emphasis>role</emphasis>,
 is used to give selected users special privileges. For more information,
see <olink targetdoc="sysadv6" targetptr="rbac-1" remap="external"><citetitle remap="section">Role-Based Access Control (Overview)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para><sect2 id="userconcept-11407"><title>User Account Components</title><para><indexterm id="userconcept-ix15"><primary>user accounts</primary><secondary>description</secondary></indexterm>The following sections describe
the specific components of a user account. </para><sect3 id="userconcept-2"><title>User (Login) Names</title><para><indexterm id="userconcept-ix28"><primary>user login names</primary><secondary>description</secondary></indexterm><indexterm id="userconcept-ix29"><primary>user accounts</primary><secondary>login names</secondary></indexterm><indexterm id="userconcept-ix30"><primary>names</primary><secondary>user login</secondary><tertiary>description</tertiary></indexterm><indexterm id="userconcept-ix31"><primary>login names (user)</primary><secondary>description</secondary></indexterm>User names, also called <replaceable>login names</replaceable>,
let users access their own systems and remote systems that have the appropriate
access privileges. You must choose a user name for each user account that
you create.   </para><para>Consider establishing a standard way of assigning user names so that
they are easier for you to track. Also, names should be easy for users to
remember. A simple scheme when selecting a user name is to use the first name
initial and first seven letters of the user's last name. For example, Ziggy
Ignatz becomes <literal>zignatz</literal>. If this scheme results in duplicate
names, you can use the first initial, middle initial, and the first six characters
of the user's last name. For example, Ziggy Top Ignatz becomes <literal>ztignatz</literal>.</para><itemizedlist><para>If this scheme still results in duplicate names, consider using the
following scheme to create a user name:</para><listitem><para>The first initial, middle initial, first five characters of
the user's last name</para>
</listitem><listitem><para>The number 1, or 2, or 3, and so on, until you have a unique
name</para>
</listitem>
</itemizedlist><note><para><indexterm id="userconcept-ix36"><primary>mail aliases</primary><secondary>user login names vs.</secondary></indexterm><indexterm id="userconcept-ix37"><primary>aliases</primary><secondary>user login names vs.</secondary></indexterm>Each new user name must be distinct from any mail
aliases that are known to the system or to an NIS or NIS+ domain. Otherwise,
mail might be delivered to the alias rather than to the actual user.  </para>
</note><para>For detailed guidelines on setting up user (login) names, see <olink targetptr="userconcept-30" remap="internal">Guidelines for Using User Names, User IDs, and
Group IDs</olink>.</para>
</sect3><sect3 id="userconcept-3"><title>User ID Numbers</title><para><indexterm id="userconcept-ix38"><primary>user ID numbers</primary></indexterm><indexterm id="userconcept-ix39"><primary>user accounts</primary><secondary>ID numbers</secondary></indexterm><indexterm id="userconcept-ix40"><primary>UIDs</primary><secondary>definition</secondary></indexterm><indexterm id="userconcept-ix41"><primary>ID numbers</primary><secondary>user</secondary></indexterm>Associated with each user name is a user identification number
(UID). The UID number identifies the user name to any system on which the
user attempts to log in. And, the UID number is used by systems to identify
the owners of files and directories. If you create user accounts for a single
individual on a number of different systems, always use the same user name
and ID number. In that way, the user can easily move files between systems
without ownership problems.   </para><para><indexterm id="userconcept-ix42"><primary>system accounts</primary></indexterm><indexterm id="userconcept-ix43"><primary>maximums</primary><secondary>user ID number</secondary></indexterm><indexterm id="userconcept-ix44"><primary><literal>bin</literal> group</primary></indexterm><indexterm id="userconcept-ix45"><primary>ID numbers</primary><secondary>group</secondary></indexterm><indexterm id="userconcept-ix46"><primary>groups</primary><secondary>ID numbers</secondary></indexterm><indexterm id="userconcept-ix47"><primary>group ID numbers</primary></indexterm><indexterm id="userconcept-ix48"><primary>GIDs</primary></indexterm><indexterm id="userconcept-ix49"><primary><literal>daemon</literal> group</primary></indexterm><indexterm id="userconcept-ix51"><primary><literal>nobody</literal> user/group</primary></indexterm><indexterm id="userconcept-ix52"><primary><literal>noaccess</literal> user/group</primary></indexterm>UID numbers must be a whole number that is less than or equal
to 2147483647. UID numbers are required for both regular user accounts and
special system accounts. The following table lists the UID numbers that are
reserved for user accounts and system accounts.        </para><table frame="topbot" id="userconcept-30971"><title>Reserved UID Numbers</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="96*"/><colspec colname="column2" colwidth="141*"/><colspec colname="column3" colwidth="159*"/><thead><row rowsep="1"><entry><para>UID Numbers</para>
</entry><entry><para>User or Login Accounts</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>0 &ndash; 99</para>
</entry><entry><para>root, <literal>daemon</literal>, <literal>bin</literal>, <literal>sys</literal>,
and so on</para>
</entry><entry><para>Reserved for use by the Solaris OS</para>
</entry>
</row><row><entry><para>100 &ndash; 2147483647</para>
</entry><entry><para>Regular users</para>
</entry><entry><para>General purpose accounts</para>
</entry>
</row><row><entry><para>60001 and 65534</para>
</entry><entry><para><literal>nobody</literal> and <literal>nobody4</literal></para>
</entry><entry><para>Anonymous users</para>
</entry>
</row><row><entry><para>60002 </para>
</entry><entry><para><literal>noaccess</literal></para>
</entry><entry><para>Non trusted users</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para><indexterm id="userconcept-ix53"><primary><literal>ttys</literal> (pseudo)</primary></indexterm><indexterm id="userconcept-ix54"><primary>pseudo-ttys</primary></indexterm><indexterm id="userconcept-ix55"><primary>pseudo user logins</primary></indexterm><indexterm id="userconcept-ix56"><primary><filename>passwd</filename> file</primary><secondary>user ID number assignment and</secondary></indexterm><indexterm id="userconcept-ix57"><primary sortas="etc/passwd file"><filename>/etc/passwd</filename> file</primary><secondary sortas="">user ID number assignment and</secondary></indexterm><indexterm id="userconcept-ix58"><primary><literal>ttytype</literal> pseudo user logins</primary></indexterm><indexterm id="userconcept-ix59"><primary>user logins (pseudo)</primary></indexterm><indexterm id="userconcept-ix60"><primary><filename>uucp</filename> group</primary></indexterm>Do not assign UIDs 0 through 99.
These UIDs are reserved for allocation by the Solaris Operating System. By
definition, <literal>root</literal> always has UID 0, <literal>daemon</literal> has
UID 1, and pseudo-user <literal>bin</literal> has UID 2. In addition, you
should give <literal>uucp</literal> logins and pseudo user logins, such as <literal>who</literal>, <literal>tty</literal>, and <literal>ttytype</literal>, low
UIDs so that they fall at the beginning of the <filename>passwd</filename> file.</para><para>For additional guidelines on setting up UIDs, see <olink targetptr="userconcept-30" remap="internal">Guidelines for Using User Names, User IDs, and
Group IDs</olink>.</para><para>As with user (login) names, you should adopt a scheme to assign unique
UID numbers. Some companies assign unique employee numbers. Then, administrators
add a number to the employee number to create a unique UID number for each
employee.</para><para><indexterm id="userconcept-ix62"><primary>security</primary><secondary>user ID number reuse and</secondary></indexterm><indexterm id="userconcept-ix63"><primary>ID numbers</primary><secondary>user</secondary></indexterm><indexterm id="userconcept-ix64"><primary>UIDs</primary><secondary>assigning</secondary></indexterm><indexterm id="userconcept-ix65"><primary>user accounts</primary><secondary>ID numbers</secondary></indexterm><indexterm id="userconcept-ix66"><primary>user ID numbers</primary></indexterm>To minimize security risks,
you should avoid reusing the UIDs from deleted accounts. If you must reuse
a UID, &ldquo;wipe the slate clean&rdquo; so that the new user is not affected
by attributes set for a former user. For example, a former user might have
been denied access to a printer by being included in a printer deny list.
However, that attribute might be inappropriate for the new user.</para>
</sect3><sect3 id="userconcept-35"><title>Using Large User IDs and Group IDs</title><para><indexterm><primary>UIDs</primary><secondary>large</secondary></indexterm><indexterm><primary>GIDs</primary><secondary>large</secondary></indexterm>UIDs and group
IDs (GIDs) can be assigned up to the maximum value of a signed integer, or
2147483647.</para><para>However, UIDs and GIDs over 60000 do not have full functionality and
are incompatible with many Solaris features. So, avoid using UIDs or GIDs
over 60000.</para><para>The following table describes interoperability issues with Solaris products
and previous Solaris releases.</para><table frame="topbot" id="userconcept-30972"><title>Interoperability Issues
for UIDs or GIDs&nbsp;Over 60000</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="98*"/><colspec colname="column2" colwidth="100*"/><colspec colname="column3" colwidth="198*"/><thead><row rowsep="1"><entry><para>Category</para>
</entry><entry><para>Product or Command</para>
</entry><entry><para>Issue</para>
</entry>
</row>
</thead><tbody><row><entry><para>NFS interoperability</para>
</entry><entry><para>SunOS 4.0 NFS software and compatible releases</para>
</entry><entry><para>NFS server and client code truncates large UIDs and GIDs to 16 bits.
This situation can create security problems if systems running SunOS 4.0 and
compatible releases are used in an environment where large UIDs and GIDs are
being used. Systems running SunOS 4.0 and compatible releases require a patch
to avoid this problem.</para>
</entry>
</row><row><entry><para>Name service interoperability</para>
</entry><entry><para>NIS name service and file-based name service</para>
</entry><entry><para>Users with UIDs greater than 60000 can log in or use the <command>su</command> command
on systems running the Solaris 2.5 (and compatible releases). However, their
UIDs and GIDs will be set to 60001 (<literal>nobody</literal>).</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para>NIS+ name service</para>
</entry><entry><para>Users with UIDs greater than 60000 are denied access on systems running
Solaris 2.5 (and compatible releases) and the NIS+ name service.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><table frame="topbot" id="userconcept-30973"><title>Large UID or GID Limitation
Summary</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="118*"/><colspec colname="column3" colwidth="278*"/><thead><row rowsep="1"><entry><para>UID or GID</para>
</entry><entry><para>Limitations</para>
</entry>
</row>
</thead><tbody><row><entry><para>60003 or greater</para>
</entry><entry><para>Users who log in to systems running Solaris 2.5 (and compatible releases)
and the NIS or files name service get a UID and GID of <literal>nobody</literal>.</para>
</entry>
</row><row><entry><para>65535 or greater</para>
</entry><entry><itemizedlist><listitem><para>Systems running Solaris 2.5 (and compatible releases) with
the NFS version 2 software truncate UIDs to 16 bits, creating possible security
problems.</para>
</listitem><listitem><para>Users who use the <command>cpio</command> command with the
default archive format to copy a file see an error message for each file.
And, the UIDs and GIDs are set to <literal>nobody</literal> in the archive.</para>
</listitem><listitem><para>x86 based systems: Users  that run SVR3-compatible applications
will probably see <literal>EOVERFLOW</literal> return codes from system calls.</para>
</listitem><listitem><para>x86 based systems: If users attempt to create a file or directory
on a mounted System V file system, the System V file system returns an <literal>EOVERFLOW</literal> error.</para>
</listitem>
</itemizedlist>
</entry>
</row><row><entry><para>100000 or greater</para>
</entry><entry><para>The <command>ps -l</command> command displays a maximum five-digit UID.
So, the printed column won't be aligned when it includes a UID or GID larger
than 99999.</para>
</entry>
</row><row><entry><para>262144 or greater</para>
</entry><entry><para>Users who use  the <command>cpio</command> command with the  <command>-H
odc</command> format or the <command>pax -x cpio</command> command to copy
files see an error message returned for each file. And, the UIDs and GIDs
are set to <literal>nobody</literal>  in the archive.</para>
</entry>
</row><row><entry><para>1000000 or greater</para>
</entry><entry><para>Users who use  the <command>ar</command> command have their UIDs and
GIDs set to <literal>nobody</literal> in the archive.</para>
</entry>
</row><row><entry><para>2097152 or greater</para>
</entry><entry><para>Users who use the <command>tar</command> command, the <command>cpio
-H ustar</command> command, or the <command>pax -x tar</command> command have
their UIDs and GIDs set to <literal>nobody</literal>.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect3><sect3 id="userconcept-35906"><title>UNIX Groups</title><para><indexterm id="userconcept-ix114"><primary>groups</primary><secondary>guidelines for managing</secondary></indexterm><indexterm id="userconcept-ix115"><primary>groups</primary><secondary>description</secondary></indexterm><indexterm id="userconcept-ix116"><primary>UNIX groups</primary></indexterm><indexterm id="userconcept-ix117"><primary>groups</primary><secondary>UNIX</secondary></indexterm>A <emphasis>group</emphasis> is a collection of users who can
share files and other system resources. For example, users who working on
the same project could be formed into a group. A group is traditionally known
as a UNIX group.</para><para><indexterm id="userconcept-ix118"><primary>ID numbers</primary><secondary>group</secondary></indexterm><indexterm id="userconcept-ix119"><primary>groups</primary><secondary>names</secondary><tertiary>description</tertiary></indexterm><indexterm id="userconcept-ix120"><primary>groups</primary><secondary>ID numbers</secondary></indexterm><indexterm id="userconcept-ix121"><primary>GIDs</primary><secondary>definition</secondary></indexterm><indexterm id="userconcept-ix122"><primary>group ID numbers</primary></indexterm><indexterm id="userconcept-ix123"><primary>groups</primary><secondary>description of names</secondary></indexterm><indexterm id="userconcept-ix124"><primary>names</primary><secondary>group</secondary><tertiary>description</tertiary></indexterm>Each group must have a name, a
group identification (GID) number, and a list of user names that belong to
the group. A GID number identifies the group internally to the system. </para><itemizedlist><para>The two types of groups that a user can belong to are as follows:</para><listitem><para><indexterm id="userconcept-ix125"><primary>primary groups</primary></indexterm><indexterm id="userconcept-ix126"><primary>groups</primary><secondary>primary</secondary></indexterm><emphasis role="strong">Primary
group &ndash;</emphasis> Specifies a group that the operating system assigns
to files that are created by the user. Each user must belong to a primary
group.  </para>
</listitem><listitem><para><indexterm id="userconcept-ix127"><primary>secondary groups</primary></indexterm><indexterm id="userconcept-ix128"><primary>groups</primary><secondary>secondary</secondary></indexterm><indexterm id="userconcept-ix129"><primary>maximums</primary><secondary>secondary groups users can belong to</secondary></indexterm><emphasis role="strong">Secondary groups &ndash;</emphasis> Specifies
one or more groups to which a user also belongs. Users can belong to up to
15 secondary groups.   </para>
</listitem>
</itemizedlist><para>For detailed guidelines on setting up group names, see <olink targetptr="userconcept-30" remap="internal">Guidelines for Using User Names, User IDs, and
Group IDs</olink>.</para><para>Sometimes, a user's secondary group is not important. For example, ownership
of files reflect the primary group, not any secondary groups. Other applications,
however, might rely on a user's secondary group memberships. For example,
a user has to be a member of the <literal>sysadmin</literal> group (group
14) to use the Admintool software in previous Solaris releases. However, it
doesn't matter if group 14 is his or her current primary group.</para><para><indexterm id="userconcept-ix130"><primary><command>groups</command> command</primary></indexterm><indexterm id="userconcept-ix131"><primary>groups</primary><secondary>displaying groups a user belongs to</secondary></indexterm><indexterm id="userconcept-ix132"><primary>groups</primary><secondary>changing primary</secondary></indexterm><indexterm id="userconcept-ix133"><primary><command>newgrp</command> command</primary></indexterm>The <command>groups</command> command lists the groups
that a user belongs to. A user can have only one primary group at a time.
However, a user can temporarily change the user's primary group, with the <command>newgrp</command> command, to any other group in which the user is a member.</para><para><indexterm id="userconcept-ix134"><primary>group ID numbers</primary></indexterm><indexterm id="userconcept-ix135"><primary>GIDs</primary><secondary>assigning</secondary></indexterm><indexterm id="userconcept-ix136"><primary><literal>staff</literal> group</primary></indexterm><indexterm id="userconcept-ix137"><primary>groups</primary><secondary>default</secondary></indexterm><indexterm id="userconcept-ix139"><primary>groups</primary><secondary>ID numbers</secondary></indexterm><indexterm id="userconcept-ix140"><primary>ID numbers</primary><secondary>group</secondary></indexterm><indexterm id="userconcept-ix141"><primary>groups</primary><secondary>secondary</secondary></indexterm><indexterm id="userconcept-ix142"><primary>secondary groups</primary></indexterm><indexterm id="userconcept-ix143"><primary>groups</primary><secondary>primary</secondary></indexterm><indexterm id="userconcept-ix144"><primary>primary groups</primary></indexterm>When adding a user account, you must assign a primary group for
a user or accept the default group, <literal>staff</literal> (group 10). The
primary group should already exist. If the primary group does not exist, specify
the group by a GID number. User names are not added to primary groups. If
user names were added to primary groups, the list might become too long. Before
you can assign users to a new secondary group, you must create the group and
assign it a GID number.</para><para><indexterm id="userconcept-ix145"><primary>NIS+</primary><secondary>groups and</secondary></indexterm><indexterm id="userconcept-ix146"><primary>name services</primary><secondary>groups and</secondary></indexterm><indexterm id="userconcept-ix147"><primary>groups</primary><secondary>name services and</secondary></indexterm><indexterm id="userconcept-ix148"><primary>groups</primary><secondary>guidelines for managing</secondary></indexterm>Groups can be local
to a system or managed through a name service. To simplify group administration,
you should use a name service such as NIS or a directory service such as LDAP.
These services enable you to centrally manage group memberships.</para>
</sect3><sect3 id="userconcept-4"><title>User Passwords</title><para>You can specify a password for a user when you add the user. Or, you
can force the user to specify a password when the user first logs in. </para><itemizedlist><para>User passwords must comply with the following syntax:</para><listitem><para>Password length must at least match the value identified by
the <literal>PASSLENGTH</literal> variable in the <literal>/etc/default/passwd</literal> file.
By default, <literal>PASSLENGTH</literal> is set to 6.</para>
</listitem><listitem><para>The first 6 characters of the password must contain at least
two alphabetic characters and have at least one numeric or special character.</para>
</listitem>
</itemizedlist><para><indexterm id="userconcept-ix67"><primary>passwords (user)</primary><secondary>precautions</secondary></indexterm><indexterm id="userconcept-ix68"><primary>passwords (user)</primary><secondary>description</secondary></indexterm><indexterm id="userconcept-ix69"><primary>minimums</primary><secondary>user password length</secondary></indexterm><indexterm id="userconcept-ix70"><primary>maximums</primary><secondary>user password length</secondary></indexterm><indexterm id="userconcept-ix71"><primary>passwords (user)</primary><secondary>setting</secondary></indexterm><indexterm id="userconcept-ix72"><primary>passwords (user)</primary><secondary>changing</secondary><tertiary sortas="passwords (user):changing:user">by user</tertiary></indexterm><indexterm id="userconcept-ix73"><primary>changing</primary><secondary>user passwords</secondary><tertiary sortas="changing:user passwords:user">by user</tertiary></indexterm>Although
user names are publicly known, passwords must be kept secret and known only
to users. Each user account should be assigned a password. The password can
be a combination of six to eight letters, numbers, or special characters.</para><para><indexterm id="userconcept-ix74"><primary>changing</primary><secondary>user passwords</secondary><tertiary>frequency of</tertiary></indexterm><indexterm id="userconcept-ix75"><primary>changing</primary><secondary>user passwords</secondary><tertiary sortas="changing:user passwords:user">by user</tertiary></indexterm><indexterm id="userconcept-ix76"><primary>passwords (user)</primary><secondary>changing</secondary><tertiary>frequency of</tertiary></indexterm><indexterm id="userconcept-ix77"><primary>passwords (user)</primary><secondary>changing</secondary><tertiary sortas="passwords (user):changing:user">by user</tertiary></indexterm><indexterm id="userconcept-ix78"><primary>passwords (user)</primary><secondary>choosing</secondary></indexterm>To make your computer systems more secure, users should change
their passwords periodically. For a high level of security, you should require
users to change their passwords every six weeks. Once every three months is
adequate for lower levels of security. System administration logins (such
as root and sys) should be changed monthly, or whenever a person who knows
the root password leaves the company or is reassigned.</para><para><indexterm id="userconcept-ix79"><primary>passwords (user)</primary><secondary>precautions</secondary></indexterm>Many breaches of computer security
involve guessing a legitimate user's password. You should make sure that users
avoid using proper nouns, names, login names, and other passwords that a person
might guess just by knowing something about the user. </para><itemizedlist><para>Good choices for passwords include the following: </para><listitem><para>Phrases (<literal>beammeup</literal>).</para>
</listitem><listitem><para>Nonsense words made up of the first letters of every word
in a phrase. For example, <literal>swotrb</literal> for SomeWhere Over The
RainBow.</para>
</listitem><listitem><para>Words with numbers or symbols substituted for letters. For
example, <literal>sn00py</literal> for snoopy.</para>
</listitem>
</itemizedlist><itemizedlist><para>Do not use these choices for passwords:</para><listitem><para>Your name (spelled forwards, backwards, or jumbled)</para>
</listitem><listitem><para>Names of family members or pets</para>
</listitem><listitem><para>Car license numbers </para>
</listitem><listitem><para>Telephone numbers</para>
</listitem><listitem><para>Social Security numbers</para>
</listitem><listitem><para>Employee numbers</para>
</listitem><listitem><para>Words related to a hobby or interest</para>
</listitem><listitem><para>Seasonal themes, such as Santa in December</para>
</listitem><listitem><para>Any word in the dictionary</para>
</listitem>
</itemizedlist>
</sect3><sect3 id="userconcept-6"><title>Home Directories</title><para><indexterm id="userconcept-ix84"><primary>user home directories</primary><secondary>description</secondary></indexterm><indexterm id="userconcept-ix86"><primary>directories</primary><secondary>home</secondary></indexterm>The home
directory is the portion of a file system allocated to a user for storing
private files. The amount of space you allocate for a home directory depends
on the kinds of files the user creates, their size, and the number of files
that are created.   </para><para><indexterm id="userconcept-ix87"><primary><filename>/home</filename> file system</primary><secondary sortas="home file system">user home directories and</secondary></indexterm><indexterm id="userconcept-ix88"><primary sortas="export/home file system"><filename>/export/home</filename> file system</primary></indexterm>A home directory can be located either on the user's local system
or on a remote file server. In either case, by convention the home directory
should be created as <filename>/export/home/</filename><replaceable>username</replaceable>.
For a large site, you should store home directories on a server. Use a separate
file system for each <filename>/export/home</filename><replaceable>n</replaceable> directory
to facilitate backing up and restoring home directories. For example, <filename>/export/home1</filename>, <filename>/export/home2</filename>.  </para><para>Regardless of where their home directory is located, users usually access
their home directories through a mount point named <filename>/home/</filename><replaceable>username</replaceable>. When AutoFS is used to mount home directories, you
are not permitted to create any directories under the <filename>/home</filename> mount
point on any system. The system recognizes the special status of <filename>/home</filename> when
AutoFS is active. For more information about automounting home directories,
see <olink targetdoc="sysadv4" targetptr="rfsadmin-127" remap="external"><citetitle remap="section">Task Overview for Autofs Administration</citetitle> in <citetitle remap="book">System Administration Guide: Network Services</citetitle></olink>.</para><para><indexterm id="userconcept-ix92"><primary>user home directories</primary><secondary>nonlocal reference to (<literal>$HOME</literal>)</secondary></indexterm>To use the home directory anywhere on the network, you should
always refer to the home directory as <literal>$HOME</literal>, not as <filename>/export/home/</filename><replaceable>username</replaceable>. The latter is
machine-specific. In addition, any symbolic links created in a user's home
directory should use relative paths (for example, <filename>../../../x/y/x</filename>)
so that the links are valid no matter where the home directory is mounted.
 </para>
</sect3><sect3 id="userconcept-1"><title>Name Services</title><para><indexterm id="userconcept-ix16"><primary>user accounts</primary><secondary>name services and</secondary></indexterm><indexterm id="userconcept-ix17"><primary>NIS</primary><secondary>user accounts and</secondary></indexterm><indexterm id="userconcept-ix19"><primary>name services</primary><secondary>user accounts and</secondary></indexterm><indexterm id="userconcept-ix20"><primary><filename>/etc</filename> files</primary><secondary sortas="etc files">user account information and</secondary></indexterm><indexterm id="userconcept-ix21"><primary>user accounts</primary><secondary>storage of information for</secondary></indexterm><indexterm id="userconcept-ix22"><primary>user accounts</primary><secondary>storage of information for</secondary></indexterm><indexterm id="userconcept-ix23"><primary><filename>/etc</filename> files</primary><secondary sortas="etc files">user account information and</secondary></indexterm><indexterm id="userconcept-ix24"><primary>name services</primary><secondary>user accounts and</secondary></indexterm><indexterm id="userconcept-ix26"><primary>NIS</primary><secondary>user accounts and</secondary></indexterm><indexterm id="userconcept-ix27"><primary>user accounts</primary><secondary>name services and</secondary></indexterm>If you
are managing user accounts for a large site, you might want to consider using
a name or directory service such as LDAP, NIS, or NIS+. A name or directory
service enables you to store user account information in a centralized manner
instead of storing user account information in every system's <filename>/etc</filename> files.
When you use a name or directory service for user accounts, users can move
from system to system using the same user account without having site-wide
user account information duplicated on every system. Using a name or directory
service also promotes centralized and consistent user account information.</para>
</sect3><sect3 id="userconcept-7"><title>User's Work Environment</title><para><indexterm id="userconcept-ix94"><primary>user initialization files</primary><secondary>description</secondary></indexterm>Besides having a home directory
to create and store files, users need an environment that gives them access
to the tools and resources they need to do their work. When a user logs in
to a system, the user's work environment is determined by initialization files.
These files are defined by the user's startup shell, such as the C, Korn,
or Bourne shell. </para><para>A good strategy for managing the user's work environment is to provide
customized user initialization files, such as <filename>.login</filename>, <filename>.cshrc</filename>, <filename>.profile</filename>, in the user's home directory. </para><note><para><indexterm id="userconcept-ix107"><primary>user home directories</primary><secondary>mounting</secondary><tertiary>automounting</tertiary></indexterm><indexterm id="userconcept-ix108"><primary>system initialization files</primary></indexterm><indexterm id="userconcept-ix109"><primary>mounting</primary><secondary>user home directories</secondary><tertiary>automounting</tertiary></indexterm><indexterm id="userconcept-ix110"><primary>initialization files</primary><secondary>system</secondary></indexterm><indexterm id="userconcept-ix111"><primary>automounting</primary><secondary>user home directories</secondary></indexterm><indexterm id="userconcept-ix112"><primary>user accounts</primary><secondary>guidelines for</secondary></indexterm><indexterm id="userconcept-ix113"><primary>user initialization files</primary><secondary>description</secondary></indexterm>Do not use system initialization files, such as <filename>/etc/profile</filename> or  <filename>/etc/.login</filename>, to manage a
user's work environment. These files reside locally on systems and are not
centrally administered. For example, if AutoFS is used to mount the user's
home directory from any system on the network, you would have to modify the
system initialization files on each system to ensure a consistent environment
whenever a user moved from system to system.       </para>
</note><para>For detailed information about customizing user initialization files
for users, see <olink targetptr="userconcept-23295" remap="internal">Customizing a User's Work
Environment</olink>.</para><para>Another way to customize user accounts is through role-based access
control (RBAC). See <olink targetdoc="sysadv6" targetptr="rbac-1" remap="external"><citetitle remap="section">Role-Based Access Control (Overview)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink> for
more information.</para>
</sect3>
</sect2><sect2 id="userconcept-30"><title>Guidelines for Using User Names, User IDs,
and Group IDs</title><para>User names, UIDs, and GIDs should be unique within your organization,
which might span multiple domains.</para><itemizedlist><para>Keep the following guidelines in mind when creating user or role names,
UIDs, and GIDs:</para><listitem><para><indexterm id="userconcept-ix32"><primary>minimums</primary><secondary>user login name length</secondary></indexterm><indexterm id="userconcept-ix33"><primary>maximums</primary><secondary>user login name length</secondary></indexterm><emphasis role="strong">User names &ndash;</emphasis> They
should contain from two to eight letters and numerals. The first character
should be a letter. At least one character should be a lowercase letter. </para><note><para>Even though user names can include a period (.), underscore (_),
or hyphen (-), using these characters is not recommended because they can
cause problems with some software products.</para>
</note>
</listitem><listitem><para><emphasis role="strong">System accounts &ndash;</emphasis> Do
not use any of the user names, UIDs, or GIDs that are contained in the default <filename>/etc/passwd</filename> and <filename>/etc/group</filename> files. Do not use
the UIDs and GIDs, 0-99. These numbers are reserved for allocation by the
Solaris Operating System and should not be used by anyone. Note that this
restriction also applies to numbers not currently in use.</para><para>For
example, <literal>gdm</literal> is the reserved user name and group name for
the GNOME Display Manager daemon and should not be used for another user.
For a complete listing of the default <literal>/etc/passwd</literal> and <literal>/etc/group</literal> entries, see <olink targetptr="userconcept-tbl-4" remap="internal">Table&nbsp;4&ndash;5</olink> and  <olink targetptr="userconcept-tbl-5" remap="internal">Table&nbsp;4&ndash;6</olink>.</para><para>The <literal>nobody</literal> and <literal>nobody4</literal> accounts
should never be used for running processes. These two accounts are reserved
for use by NFS. Use of these accounts for running processes could lead to
unexpected security risks. Processes that need to run as a non-root user should
use the <literal>daemon</literal> or <literal>noaccess</literal> accounts.</para>
</listitem><listitem><para><emphasis role="strong">System account configuration</emphasis> &ndash;
The configuration of the default system accounts should never be changed.
This includes changing the login shell of a system account that is currently
locked. The only exception to this rule is the setting of a password and password
aging parameters for the root account.</para>
</listitem>
</itemizedlist>
</sect2>
</sect1><sect1 id="userconcept-23283"><title>Where User Account and Group Information
Is Stored</title><itemizedlist><para>Depending on your site policy, user account and group information can
be stored in your local system's <filename>/etc</filename> files or in a name
or directory service as follows: </para><listitem><para>The NIS+ name service information is stored in tables.</para>
</listitem><listitem><para>The NIS name service information is stored in maps.</para>
</listitem><listitem><para>The LDAP directory service information is stored in indexed
database files.</para>
</listitem>
</itemizedlist><note><para>To avoid confusion, the location of the user account and group
information is generically referred to as a <emphasis>file</emphasis> rather
than as a <emphasis>database</emphasis>, <emphasis>table</emphasis>, or <emphasis>map</emphasis>.</para>
</note><itemizedlist><para>Most user account information is stored in the <filename>passwd</filename> file.
Password information is stored as follows:</para><listitem><para>In the <filename>passwd</filename> file when you are using
NIS or NIS+</para>
</listitem><listitem><para>In the <filename>/etc/shadow</filename> file when you are
using <filename>/etc</filename> files</para>
</listitem><listitem><para>In the <filename>people</filename> container when you are
using LDAP</para>
</listitem>
</itemizedlist><para><indexterm id="userconcept-ix416"><primary sortas="etc/passwd file"><filename>/etc/passwd</filename> file</primary><secondary sortas="">description</secondary></indexterm><indexterm id="userconcept-ix417"><primary>aging user passwords</primary></indexterm><indexterm id="userconcept-ix418"><primary>encryption</primary></indexterm><indexterm id="userconcept-ix419"><primary sortas="etc/passwd file"><filename>/etc/passwd</filename> file</primary></indexterm><indexterm id="userconcept-ix420"><primary><filename>/etc/shadow</filename> file</primary><secondary sortas="etc/shadow file">description</secondary></indexterm><indexterm id="userconcept-ix421"><primary>name services</primary><secondary>user accounts and</secondary></indexterm><indexterm id="userconcept-ix423"><primary>NIS</primary><secondary>user accounts and</secondary></indexterm><indexterm id="userconcept-ix424"><primary><filename>passwd</filename> file</primary></indexterm><indexterm id="userconcept-ix425"><primary>passwords (user)</primary><secondary>aging</secondary></indexterm><indexterm id="userconcept-ix426"><primary>passwords (user)</primary><secondary>encryption</secondary></indexterm><indexterm id="userconcept-ix427"><primary><filename>shadow</filename> file</primary><secondary>description</secondary></indexterm><indexterm id="userconcept-ix428"><primary>user accounts</primary><secondary>name services and</secondary></indexterm>Password aging is available when you are using NIS+ or LDAP, but
not NIS.</para><para><indexterm id="userconcept-ix429"><primary>groups</primary><secondary>storage of information for</secondary></indexterm><indexterm id="userconcept-ix430"><primary><filename>group</filename> file</primary><secondary>description</secondary></indexterm>Group information is stored in the <filename>group</filename> file
for NIS, NIS+ and files. For LDAP, group information is stored in the <filename>group</filename> container. </para><sect2 id="userconcept-74705"><title>Fields in the <filename>passwd</filename> File</title><para><indexterm id="userconcept-ix431"><primary><filename>passwd</filename> file</primary><secondary>fields in</secondary></indexterm><indexterm id="userconcept-ix432"><primary sortas="etc/passwd file"><filename>/etc/passwd</filename> file</primary><secondary sortas="">fields in</secondary></indexterm>The fields
in the <filename>passwd</filename> file are separated by colons and contain
the following information:  </para><screen><replaceable>username</replaceable>:<replaceable>password</replaceable>:<replaceable>uid</replaceable>:<replaceable>gid</replaceable>:<replaceable>comment</replaceable>:<replaceable>home</replaceable>-<replaceable>directory</replaceable>:<replaceable>login-shell</replaceable></screen><para>For example:</para><screen>kryten:x:101:100:Kryten Series 4000 Mechanoid:/export/home/kryten:/bin/csh</screen><para>For a complete description of the fields in the <filename>passwd</filename> file,
see the <olink targetdoc="refman" targetptr="passwd-1" remap="external"><citerefentry><refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para>
</sect2><sect2 id="userconcept-20"><title>Default <filename>passwd</filename> File</title><para>The default Solaris <filename>passwd</filename> file contains entries
for standard daemons. Daemons are processes that are usually started at boot
time to perform some system-wide task, such as printing, network administration,
or port monitoring.</para><screen>root:x:0:1:Super-User:/:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
smmsp:x:25:25:SendMail Message Submission Program:/:
listen:x:37:4:Network Admin:/usr/net/nls:
gdm:x:50:50:GDM Reserved UID:/:
webservd:x:80:80:WebServer Reserved UID:/:
nobody:x:60001:60001:NFS Anonymous Access User:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:</screen><table frame="topbot" id="userconcept-tbl-4"><title>Default <filename>passwd</filename> File
Entries</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="92*"/><colspec colname="colspec1" colwidth="92*"/><colspec colname="column2" colwidth="212*"/><thead><row rowsep="1"><entry><para>User Name</para>
</entry><entry><para>User ID</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>root</literal></para>
</entry><entry><para><literal>0</literal></para>
</entry><entry><para>Superuser account</para>
</entry>
</row><row><entry><para><literal>daemon</literal> </para>
</entry><entry><para><literal>1</literal></para>
</entry><entry><para>Umbrella system daemon associated with routine system tasks</para>
</entry>
</row><row><entry><para><literal>bin</literal></para>
</entry><entry><para><literal>2</literal></para>
</entry><entry><para>Administrative daemon associated with running system binaries to perform
some routine system task</para>
</entry>
</row><row><entry><para><literal>sys</literal></para>
</entry><entry><para><literal>3</literal></para>
</entry><entry><para>Administrative daemon associated with system logging or updating files
in temporary directories</para>
</entry>
</row><row><entry><para><literal>adm</literal></para>
</entry><entry><para><literal>4</literal></para>
</entry><entry><para>Administrative daemon associated with system logging</para>
</entry>
</row><row><entry><para><literal>lp</literal></para>
</entry><entry><para><literal>71</literal></para>
</entry><entry><para>Line printer daemon</para>
</entry>
</row><row><entry><para><literal>uucp</literal></para>
</entry><entry><para><literal>5</literal></para>
</entry><entry><para>Daemon associated with <command>uucp</command> functions</para>
</entry>
</row><row><entry><para><literal>nuucp</literal></para>
</entry><entry><para><literal>6</literal></para>
</entry><entry><para>Another daemon associated with <command>uucp</command> functions</para>
</entry>
</row><row><entry><para><literal>smmsp</literal></para>
</entry><entry><para><literal>25</literal></para>
</entry><entry><para>Sendmail message submission program daemon</para>
</entry>
</row><row><entry><para><literal>webservd</literal></para>
</entry><entry><para><literal>80</literal></para>
</entry><entry><para>Account reserved for WebServer access</para>
</entry>
</row><row><entry><para><literal>gdm</literal></para>
</entry><entry><para>50</para>
</entry><entry><para>GNOME Display Manager daemon</para>
</entry>
</row><row><entry><para><literal>listen</literal></para>
</entry><entry><para><literal>37</literal></para>
</entry><entry><para>Network listener daemon</para>
</entry>
</row><row><entry><para><literal>nobody</literal></para>
</entry><entry><para><literal>60001</literal></para>
</entry><entry><para>Account reserved for anonymous NFS access.</para>
</entry>
</row><row><entry><para><literal>noaccess</literal></para>
</entry><entry><para><literal>60002</literal></para>
</entry><entry><para>Assigned to a user or a process that needs access to a system through
some application but without actually logging in.</para>
</entry>
</row><row><entry><para><literal>nobody4</literal></para>
</entry><entry><para><literal>65534</literal></para>
</entry><entry><para>SunOS 4.0 or 4.1 version of the <literal>nobody</literal> user account</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="userconcept-15"><title>Fields in the <filename>shadow</filename> File</title><para><indexterm id="userconcept-ix443"><primary><filename>shadow</filename> file</primary><secondary>fields in</secondary></indexterm>The fields in the <filename>shadow</filename> file are separated by colons and contain the following information: </para><screen><replaceable>username</replaceable>:<replaceable>password</replaceable>:<replaceable>lastchg</replaceable>:<replaceable>min</replaceable>:<replaceable>max</replaceable>:<replaceable>warn</replaceable>:<replaceable>inactive</replaceable>:<replaceable>expire</replaceable></screen><para>For example:</para><screen>rimmer:86Kg/MNT/dGu.:8882:0::5:20:8978</screen><para>For a complete description of the fields in the <filename>shadow</filename> file,
see the <olink targetdoc="refman" targetptr="shadow-4" remap="external"><citerefentry><refentrytitle>shadow</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> and <olink targetdoc="refman" targetptr="crypt-1" remap="external"><citerefentry><refentrytitle>crypt</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man pages.</para>
</sect2><sect2 id="userconcept-16"><title>Fields in the <filename>group</filename> File</title><para><indexterm id="userconcept-ix462"><primary><filename>group</filename> file</primary><secondary>fields in</secondary></indexterm><indexterm id="userconcept-ix463"><primary>groups</primary><secondary>storage of information for</secondary></indexterm>The fields in the <filename>group</filename> file are separated
by colons and contain the following information:  </para><screen><replaceable>group-name</replaceable>:<replaceable>group-password</replaceable>:<replaceable>gid</replaceable>:<replaceable>user-list</replaceable></screen><para>For example:</para><screen>bin::2:root,bin,daemon</screen><para>For a complete description of the fields in the <filename>group</filename> file,
see the <olink targetdoc="refman" targetptr="group-4" remap="external"><citerefentry><refentrytitle>group</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page.</para>
</sect2><sect2 id="userconcept-17"><title>Default <filename>group</filename> File</title><para>The default Solaris <filename>group</filename> file contains the following
system groups that support some system-wide task, such as printing, network
administration, or electronic mail. Many of these groups having corresponding
entries in the <filename>passwd</filename> file.</para><screen>root::0:
other::1:
bin::2:root,daemon
sys::3:root,bin,adm
adm::4:root,daemon
uucp::5:root
mail::6:root
tty::7:root,adm
lp::8:root,adm
nuucp::9:root
staff::10:
daemon::12:root
smmsp::25:
sysadmin::14:
gdm::50:
webservd::80:
nobody::60001:
noaccess::60002:
nogroup::65534:</screen><table frame="topbot" id="userconcept-tbl-5"><title>Default <filename>group</filename> File
Entries</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="92*"/><colspec colname="colspec0" colwidth="92*"/><colspec colname="column2" colwidth="212*"/><thead><row rowsep="1"><entry><para>Group Name</para>
</entry><entry><para>Group ID</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>root</literal></para>
</entry><entry><para><literal>0</literal></para>
</entry><entry><para>Superuser group</para>
</entry>
</row><row><entry><para><literal>other</literal></para>
</entry><entry><para><literal>1</literal></para>
</entry><entry><para>Optional group</para>
</entry>
</row><row><entry><para><literal>bin</literal></para>
</entry><entry><para><literal>2</literal></para>
</entry><entry><para>Administrative group associated with running system binaries</para>
</entry>
</row><row><entry><para><literal>sys</literal></para>
</entry><entry><para><literal>3</literal></para>
</entry><entry><para>Administrative group associated with system logging or temporary directories</para>
</entry>
</row><row><entry><para><literal>adm</literal></para>
</entry><entry><para><literal>4</literal></para>
</entry><entry><para>Administrative group associated with system logging</para>
</entry>
</row><row><entry><para><literal>uucp</literal></para>
</entry><entry><para><literal>5</literal></para>
</entry><entry><para>Group associated with <command>uucp</command> functions</para>
</entry>
</row><row><entry><para><literal>mail</literal></para>
</entry><entry><para><literal>6</literal></para>
</entry><entry><para>Electronic mail group</para>
</entry>
</row><row><entry><para><literal>tty</literal></para>
</entry><entry><para><literal>7</literal></para>
</entry><entry><para>Group associated with tty devices</para>
</entry>
</row><row><entry><para><literal>lp</literal></para>
</entry><entry><para><literal>8</literal></para>
</entry><entry><para>Line printer group</para>
</entry>
</row><row><entry><para><literal>nuucp</literal></para>
</entry><entry><para><literal>9</literal></para>
</entry><entry><para>Group associated with <command>uucp</command> functions</para>
</entry>
</row><row><entry><para><literal>staff</literal></para>
</entry><entry><para><literal>10</literal></para>
</entry><entry><para>General administrative group.</para>
</entry>
</row><row><entry><para><literal>daemon</literal></para>
</entry><entry><para><literal>12</literal></para>
</entry><entry><para>Group associated with routine system tasks</para>
</entry>
</row><row><entry><para><literal>sysadmin</literal></para>
</entry><entry><para><literal>14</literal></para>
</entry><entry><para>Administrative group associated with legacy Admintool and Solstice AdminSuite
tools</para>
</entry>
</row><row><entry><para><literal>smmsp</literal></para>
</entry><entry><para>25</para>
</entry><entry><para>Daemon for Sendmail message submission program</para>
</entry>
</row><row><entry><para><literal>webservd</literal></para>
</entry><entry><para><literal>80</literal></para>
</entry><entry><para>Group reserved for WebServer access</para>
</entry>
</row><row><entry><para><literal>gdm</literal></para>
</entry><entry><para>50</para>
</entry><entry><para>Group reserved for the GNOME Display Manager daemon</para>
</entry>
</row><row><entry><para><literal>nobody</literal></para>
</entry><entry><para><literal>60001</literal></para>
</entry><entry><para>Group assigned for anonymous NFS access</para>
</entry>
</row><row><entry><para><literal>noaccess</literal></para>
</entry><entry><para><literal>60002</literal></para>
</entry><entry><para>Group assigned to a user or a process that needs access to a system
through some application but without actually logging in</para>
</entry>
</row><row><entry><para><literal>nogroup</literal></para>
</entry><entry><para><literal>65534</literal></para>
</entry><entry><para>Group assigned to a user who is not a member of a known group</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
</sect1><sect1 id="userconcept-16910"><title>Tools for Managing User Accounts and
Groups</title><para>The following table lists the recommended tools for managing users and
groups. These tools are included in the Solaris Management Console suite of
tools. For information about starting and using the Solaris Management Console,
see <olink targetptr="smcover-1" remap="internal">Chapter&nbsp;2, Working With the Solaris
Management Console (Tasks)</olink>.</para><table frame="topbot" id="userconcept-tbl-10"><title>Tools for Managing Users
and Groups</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="33*"/><colspec colname="colspec1" colwidth="33*"/><thead><row rowsep="1"><entry><para>Solaris Management Tool</para>
</entry><entry><para>Purpose</para>
</entry>
</row>
</thead><tbody><row><entry><para>Users</para>
</entry><entry><para>Manage users accounts</para>
</entry>
</row><row><entry><para>User Templates </para>
</entry><entry><para>Create a set of attributes for a specific kind of user like students,
engineers, or instructors</para>
</entry>
</row><row><entry><para>Rights</para>
</entry><entry><para>Manage RBAC rights</para>
</entry>
</row><row><entry><para>Administrative Roles </para>
</entry><entry><para>Manage RBAC administrative roles</para>
</entry>
</row><row><entry><para>Groups</para>
</entry><entry><para>Manage group information</para>
</entry>
</row><row><entry><para>Projects</para>
</entry><entry><para>Manage project information</para>
</entry>
</row><row><entry><para>Mailing Lists</para>
</entry><entry><para>Manage mailing lists</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>Use the Solaris Management Console online help for information on performing
these tasks.</para><para>For information on the Solaris commands that can be used to manage user
accounts and groups, see <olink targetptr="saroadmap-tbl-4" remap="internal">Table&nbsp;1&ndash;6</olink>.
These commands provide the same functionality as the Solaris management tools,
including authentication and name service support.</para><sect2 id="userconcept-11333"><title>Tasks for Solaris User and Group Management
Tools</title><para>The Solaris user management tools enable you to manage user accounts
and groups on a local system or in a name service environment.</para><para>This table describes the tasks you can do with the Users tool's User
Accounts feature.</para><table frame="topbot" id="userconcept-tbl-3"><title>Task Descriptions for
User Accounts Tool</title><tgroup cols="2" colsep="0" rowsep="0"><?PubTbl tgroup dispwid="5.53in"?><colspec colname="colspec0" colwidth="43.68*"/><colspec colname="colspec1" colwidth="59.32*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>Add a user</para>
</entry><entry><para>Adds a user to the local system or name service.</para>
</entry>
</row><row><entry><para>Create a user template</para>
</entry><entry><para>Creates a template of predefined user attributes for creating users
of the same group, such as students, contractors, or engineers.</para>
</entry>
</row><row><entry><para>Add a user with a user template</para>
</entry><entry><para>Adds a user with a template so that user attributes are predefined.</para>
</entry>
</row><row><entry><para>Clone a user template</para>
</entry><entry><para>Clones a user template if you would like to use a similar set of predefined
user attributes. Then, change only some of the attributes as needed.</para>
</entry>
</row><row><entry><para>Set up user properties</para>
</entry><entry><para>Sets up user properties in advance of adding users. Properties include
specifying whether a user template is used when adding a user, and whether
the home directory or mail box is deleted by default when removing a user.</para>
</entry>
</row><row><entry><para>Add multiple users</para>
</entry><entry><para>Adds multiple users to the local system or name service by specifying
a text file, typing each name, or automatically generating a series of user
names.</para>
</entry>
</row><row><entry><para>View or change user properties</para>
</entry><entry><para>Displays or changes user properties such as login shell, password, or
password options.</para>
</entry>
</row><row><entry><para>Assign rights to users</para>
</entry><entry><para>Assigns RBAC rights to users that will allow them to perform specific
administration tasks.</para>
</entry>
</row><row><entry><para>Remove a user</para>
</entry><entry><para>Removes the user from the local system or the name service. Optionally,
you can also specify whether the user's home directory or mailbox is removed.
The user is also removed from any groups or roles.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>For information about adding a user to the local system or name service,
see <olink targetptr="userconcept-36940" remap="internal">What Are User Accounts and Groups?</olink> and <olink targetptr="userconcept-11407" remap="internal">User Account Components</olink>.</para><table frame="topbot" id="userconcept-tbl-8"><title>Task Descriptions for
Rights Tool</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colwidth="45.25*"/><colspec colwidth="54.75*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><?PubTbl row rht="0.53in"?><entry><para>Grant a right</para>
</entry><entry><para>Grants a user a right to run a specific command or application that
was previously only available to an administrator.</para>
</entry>
</row><row><entry><para>View or change existing rights properties</para>
</entry><entry><para>Displays or changes existing rights.</para>
</entry>
</row><row><entry><para>Add an authorization</para>
</entry><entry><para>Adds an authorization, which is a discrete right granted to a role or
a user.</para>
</entry>
</row><row><entry><para>View or change an authorization</para>
</entry><entry><para>Displays or changes existing authorizations.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>For more information on granting rights to users, see <olink targetdoc="sysadv6" targetptr="rbacref-26" remap="external"><citetitle remap="section">Contents of Rights Profiles</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para><table frame="topbot" id="userconcept-tbl-6"><title>Task Descriptions for
Administrative Roles Tool</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="40.91*"/><colspec colname="colspec1" colwidth="54.55*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>Add an administrative role</para>
</entry><entry><para>Adds a role that someone would use to perform a specific administrative
task.</para>
</entry>
</row><row><entry><para>Assign rights to an administrative role</para>
</entry><entry><para>Assigns specific rights to a role that enable someone to perform a task.</para>
</entry>
</row><row><entry><para>Change an administrative role</para>
</entry><entry><para>Adds or removes rights from a role.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>For more information on using administrative roles, see <olink targetdoc="sysadv6" targetptr="rbactask-16" remap="external"><citetitle remap="section">How to Plan Your RBAC Implementation</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para><table frame="topbot" id="userconcept-tbl-9"><title>Task Descriptions for
Groups Tool</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colwidth="41.21*"/><colspec colwidth="54.39*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>Add a group</para>
</entry><entry><para>Adds a group to the local system or name service so that the group name
is available before you add the user.</para>
</entry>
</row><row><entry><para>Add a user to a group</para>
</entry><entry><para>Adds a user to a group if the user needs access to group-owned files.</para>
</entry>
</row><row><entry><para>Remove a user from a group</para>
</entry><entry><para>Removes a user from a group if the user no longer requires group file
access.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>For information on adding users to groups, see <olink targetptr="userconcept-35906" remap="internal">UNIX Groups</olink>.</para><table frame="topbot" id="userconcept-tbl-1"><title>Task Descriptions for
Mailing Lists Tool</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colwidth="47.11*"/><colspec colwidth="62.96*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>Create a mailing list</para>
</entry><entry><para>Creates a mailing list, which is a list of user names for sending email
messages.</para>
</entry>
</row><row><entry><para>Change a mailing list name</para>
</entry><entry><para>Changes the mailing list after it is created.</para>
</entry>
</row><row><entry><para>Remove a mailing list</para>
</entry><entry><para>Removes a mailing list if it is no longer used.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>For information on creating mailing lists, see the Solaris Management
Console's online help.</para><table frame="topbot" id="userconcept-tbl-7"><title>Task Descriptions for
Projects Tool</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colwidth="47.11*"/><colspec colwidth="62.96*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>Create or clone a project</para>
</entry><entry><para>Creates a new project or clones an existing project if the existing
project has attributes similar to what you need for the new project.</para>
</entry>
</row><row><entry><para>Modify or view project attributes</para>
</entry><entry><para>Displays or changes existing project attributes.</para>
</entry>
</row><row><entry><para>Delete a project</para>
</entry><entry><para>Removes a project if the project is no longer used.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="userconcept-10"><title>Managing Users and Resources With Projects</title><para>Starting with the Solaris 9 release, users and groups can be members
of a <emphasis>project</emphasis>, an identifier that indicates a workload
component that can be used as the basis of system usage or resource allocation
chargeback. Projects are part of the Solaris resource management feature that
is used to manage system resources.</para><para>Users need to be a member of a project to successfully log in to a system
running the Solaris 9 release. By default, users are a member of the <literal>group.staff</literal> project when the Solaris 9 release is installed and no other project
information is configured.</para><para>User project information is stored in the <filename>/etc/project</filename> file,
which can be stored on the local system (files), the NIS name service, or
the LDAP directory service. You can use the Solaris Management Console to
manage project information.</para><para>The <filename>/etc/project</filename> file must exist for users to log
in successfully, but requires no administration if you are not using projects.</para><para>For more information on using or setting up projects, see <olink targetdoc="sysadrm" targetptr="rmtaskproj-1" remap="external">Chapter 2, <citetitle remap="chapter">Projects and Tasks (Overview),</citetitle> in <citetitle remap="book">System Administration Guide:  Virtualization Using the Solaris Operating System</citetitle></olink>.</para>
</sect2>
</sect1><sect1 id="userconcept-23295"><title>Customizing a User's Work Environment</title><para><indexterm id="userconcept-ix503"><primary>user initialization files</primary><secondary>description</secondary></indexterm><indexterm id="userconcept-ix505"><primary>user initialization files</primary><secondary>customizing</secondary></indexterm><indexterm><primary>user initialization files</primary><secondary>Bourne shell</secondary></indexterm>Part of setting up a user's home directory is
providing user initialization files for the user's login shell. A <emphasis>user
initialization file</emphasis> is a shell script that sets up a work environment
for a user after the user logs in to a system. Basically, you can perform
any task in a user initialization file that you can do in a shell script.
However, a user initialization file's primary job is to define the characteristics
of a user's work environment, such as a user's search path, environment variables,
and windowing environment. Each login shell has its own user initialization
file or files, which are listed in the following table.     </para><table frame="topbot" id="userconcept-90062"><title>User Initialization Files
for Bourne, C, and Korn Shells</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="80*"/><colspec colname="column2" colwidth="118*"/><colspec colname="column3" colwidth="198*"/><thead><row rowsep="1"><entry><para>Shell</para>
</entry><entry><para>User Initialization File</para>
</entry><entry><para>Purpose</para>
</entry>
</row>
</thead><tbody><row><entry><para>Bourne</para>
</entry><entry><para><filename>$HOME/.profile</filename></para>
</entry><entry><para>Defines the user's environment at login</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix508"><primary><filename>.cshrc</filename> file</primary><secondary sortas="cshrc file">description</secondary></indexterm><indexterm id="userconcept-ix509"><primary>C shell</primary><secondary>user initialization files and</secondary></indexterm>C  </para>
</entry><entry><para><filename>$HOME/.cshrc</filename></para>
</entry><entry><para>Defines the user's environment for all C shells and is invoked after
login shell</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><indexterm id="userconcept-ix510"><primary><filename>.login</filename> file</primary><secondary sortas="login file">description</secondary></indexterm><filename>$HOME/.login</filename> </para>
</entry><entry><para>Defines the user's environment at login</para><para></para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix511"><primary>Korn shell</primary><secondary>user initialization files and</secondary></indexterm>Korn </para>
</entry><entry><para><indexterm id="userconcept-ix512"><primary><filename>.profile</filename> file</primary><secondary sortas="profile file">description</secondary></indexterm><filename>$HOME/.profile</filename> </para>
</entry><entry><para>Defines the user's environment at login</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><literal>$HOME/$ENV</literal> </para>
</entry><entry><para>Defines user's environment at login in the file and is specified by
the Korn shell's <command>ENV</command> environment variable</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para><indexterm id="userconcept-ix515"><primary>user initialization files</primary><secondary>default</secondary></indexterm><indexterm id="userconcept-ix516"><primary sortas="skel directory"><filename>/skel</filename> directory</primary></indexterm><indexterm id="userconcept-ix517"><primary sortas="etc/skel directory"><filename>/etc/skel</filename> directory</primary></indexterm>The Solaris environment provides default user initialization files
for each shell in the <filename>/etc/skel</filename> directory on each system,
as shown in the following table.    </para><table frame="topbot" id="userconcept-60246"><title>Default User Initialization
Files</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="119*"/><colspec colname="column2" colwidth="277*"/><thead><row rowsep="1"><entry><para>Shell</para>
</entry><entry><para>Default File</para>
</entry>
</row>
</thead><tbody><row><entry><para><indexterm id="userconcept-ix519"><primary>C shell</primary><secondary>user initialization files and</secondary><see>user initialization files</see></indexterm>C </para>
</entry><entry><para><indexterm id="userconcept-ix520"><primary><filename>local.login</filename> file</primary></indexterm><filename>/etc/skel/local.login</filename> </para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><indexterm id="userconcept-ix521"><primary><filename>local.cshrc</filename> file</primary></indexterm><filename>/etc/skel/local.cshrc</filename> </para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix523"><primary>Bourne shell</primary><seealso>user initialization files</seealso></indexterm>Bourne or Korn  </para>
</entry><entry><para><indexterm id="userconcept-ix524"><primary><filename>local.profile</filename> file</primary></indexterm><filename>/etc/skel/local.profile</filename> </para>
</entry>
</row>
</tbody>
</tgroup>
</table><para><indexterm id="userconcept-ix355"><primary>user home directories</primary><secondary>customized initialization files in</secondary></indexterm><indexterm id="userconcept-ix357"><primary>skeleton directories (<filename>/etc/skel</filename>)</primary></indexterm><indexterm id="userconcept-ix358"><primary>directories</primary><secondary>skeleton</secondary></indexterm><indexterm id="userconcept-ix359"><primary>adding</primary><secondary>user initialization files</secondary></indexterm><indexterm id="userconcept-ix360"><primary>user initialization files</primary><secondary>customizing</secondary><tertiary>adding customized files</tertiary></indexterm>You can use these files as a starting point and
modify them to create a standard set of files that provide the work environment
common to all users. Or, you can modify these files to provide the working
environment for different types of users. Although you cannot create customized
user initialization files with the Users tool, you can populate a user's home
directory with user initialization files located in a specified &ldquo;skeleton&rdquo;
directory. You can do this by creating a user template with the User Templates
tool and specifying a skeleton directory from which to copy user initialization
files. </para><para><indexterm id="userconcept-ix525"><primary>user initialization files</primary><secondary>customizing</secondary><tertiary>overview</tertiary></indexterm>For
step-by-step instructions on how to create sets of user initialization files
for different types of users, see <olink targetptr="usersetup-52714" remap="internal">How to
Customize User Initialization Files</olink>.</para><para>When you use the Users tool to create a new user account and select
the create home directory option, the following files are created, depending
on which login shell is selected.</para><table frame="topbot" id="userconcept-tbl-15"><title>Files Created by Users
Tool When Adding a User</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="27.47*"/><colspec colname="colspec1" colwidth="72.53*"/><thead><row rowsep="1"><entry><para>Shell</para>
</entry><entry><para>Files Created</para>
</entry>
</row>
</thead><tbody><row><entry><para>C </para>
</entry><entry><para>The <filename>/etc/skel/local.cshrc</filename> and the <filename>/etc/skel/local.login</filename> files are copied into the user's home directory and are renamed <filename>.cshrc</filename> and <filename>.login</filename>, respectively.</para>
</entry>
</row><row><entry><para>Bourne and Korn</para>
</entry><entry><para>The <filename>/etc/skel/local.profile</filename> file is copied into
the user's home directory and renamed <filename>.profile.</filename></para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>If you use the <command>useradd</command> command to add a new user
account and specify the <filename>/etc/skel</filename> directory by using
the <option>k</option> and <option>m</option> options, all three <filename>/etc/skel/local</filename>* files and the <filename>/etc/skel/.profile</filename> file are
copied into the user's home directory. At this point, you need to rename them
to whatever is appropriate for the user's login shell.</para><sect2 id="userconcept-42091"><title>Using Site Initialization Files</title><para><indexterm id="userconcept-ix526"><primary>user initialization files</primary><secondary>customizing</secondary><tertiary>site initialization files</tertiary></indexterm><indexterm id="userconcept-ix527"><primary>site initialization files</primary></indexterm>The user initialization files can be customized
by both the administrator and the user. This important feature can be accomplished
with centrally located and globally distributed user initialization files,
called <emphasis>site initialization files</emphasis>. Site initialization
files enable you to continually introduce new functionality to the user's
work environment, while enabling the user to customize the user's initialization
file.</para><para>When you reference a site initialization file in a user initialization
file, all updates to the site initialization file are automatically reflected
when the user logs in to the system or when a user starts a new shell. Site
initialization files are designed for you to distribute site-wide changes
to users' work environments that you did not anticipate when you added the
users.</para><para>You can customize a site initialization file the same way that you customize
a user initialization file. These files typically reside on a server, or set
of servers, and appear as the first statement in a user initialization file.
Also, each site initialization file must be the same type of shell script
as the user initialization file that references it.</para><para><indexterm id="userconcept-ix528"><primary>user initialization files</primary><secondary>shells and</secondary></indexterm><indexterm id="userconcept-ix530"><primary>C shell</primary><secondary>user initialization files and</secondary><tertiary>to reference a site initialization file</tertiary></indexterm>To
reference a site initialization file in a C-shell user initialization file,
place a line similar to the following at the beginning of the user initialization
file:</para><screen>source /net/<replaceable>machine-name/export/site-files/site-init-file</replaceable></screen><para>To reference a site initialization file in a Bourne-shell or Korn-shell
user initialization file, place a line similar to the following at the beginning
of the user initialization file:  </para><screen>. /net/<replaceable>machine-name/export/site-files/site-init-file</replaceable></screen>
</sect2><sect2 id="userconcept-18"><title>Avoiding Local System References</title><para><indexterm id="userconcept-ix533"><primary>user initialization files</primary><secondary>customizing</secondary><tertiary>avoiding local system references</tertiary></indexterm><indexterm id="userconcept-ix534"><primary>user home directories</primary><secondary>nonlocal reference to (<literal>$HOME</literal>)</secondary></indexterm>You should not add specific references to the local system in
the user initialization file. You want the instructions in a user initialization
file to be valid regardless of which system the user logs into. </para><itemizedlist><para>For example:</para><listitem><para>To make a user's home directory available anywhere on the
network, always refer to the home directory with the variable <literal>$HOME</literal>.
For example, use <literal>$HOME/bin</literal> instead of <filename>/export/home/</filename><replaceable>username</replaceable><filename>/bin</filename>. The <literal>$HOME</literal> variable
works when the user logs in to another system and the home directories are
automounted. </para>
</listitem><listitem><para>To access files on a local disk, use global path names, such
as <filename>/net/</filename><replaceable>system-name/directory-name</replaceable>.
Any directory referenced by <filename>/net/</filename><replaceable>system-name</replaceable> can
be mounted automatically on any system on which the user logs in, assuming
the system is running AutoFS.</para>
</listitem>
</itemizedlist>
</sect2><sect2 id="userconcept-19"><title>Shell Features</title><para><indexterm id="userconcept-ix536"><primary>C shell</primary><secondary>user initialization files and</secondary><tertiary>creating</tertiary></indexterm><indexterm id="userconcept-ix537"><primary>C shell</primary><secondary>basic features</secondary></indexterm><indexterm id="userconcept-ix538"><primary>Bourne shell</primary><seealso>user initialization files</seealso></indexterm><indexterm id="userconcept-ix539"><primary>Bourne shell</primary><secondary>basic features</secondary></indexterm><indexterm id="userconcept-ix540"><primary><filename>.cshrc</filename> file</primary><secondary sortas="cshrc file">customizing</secondary></indexterm><indexterm id="userconcept-ix541"><primary>Korn shell</primary><secondary>basic features</secondary></indexterm><indexterm id="userconcept-ix543"><primary><filename>.login</filename> file</primary><secondary sortas="login file">customizing</secondary></indexterm><indexterm id="userconcept-ix544"><primary><filename>.profile</filename> file</primary><secondary sortas="profile file">customizing</secondary></indexterm><indexterm id="userconcept-ix545"><primary>shells</primary><secondary>basic features</secondary></indexterm><indexterm id="userconcept-ix547"><primary>user initialization files</primary><secondary>shells and</secondary></indexterm>The following
table lists basic shell features that each shell provides, which can help
you determine what you can and can't do when creating user initialization
files for each shell.            </para><table frame="topbot" id="userconcept-75869"><title>Basic Features of Bourne,
C, and Korn Shells</title><tgroup cols="4" colsep="0" rowsep="0"><colspec colname="column1" colwidth="159*"/><colspec colname="column2" colwidth="80*"/><colspec colname="column3" colwidth="79*"/><colspec colname="column4" colwidth="78*"/><thead><row rowsep="1"><entry><para>Feature</para>
</entry><entry><para>Bourne</para>
</entry><entry><para>C</para>
</entry><entry><para>Korn</para>
</entry>
</row>
</thead><tbody><row><entry><para>Known as the standard shell in UNIX</para>
</entry><entry><para>Applicable</para>
</entry><entry><para>N/A</para>
</entry><entry><para>N/A</para>
</entry>
</row><row><entry><para>Compatible syntax with Bourne shell</para>
</entry><entry><para>-</para>
</entry><entry><para>N/A</para>
</entry><entry><para>Applicable</para>
</entry>
</row><row><entry><para>Job control</para>
</entry><entry><para>Applicable</para>
</entry><entry><para>Applicable</para>
</entry><entry><para>Applicable</para>
</entry>
</row><row><entry><para>History list</para>
</entry><entry><para>N/A</para>
</entry><entry><para>Applicable</para>
</entry><entry><para>Applicable</para>
</entry>
</row><row><entry><para>Command-line editing</para>
</entry><entry><para>N/A</para>
</entry><entry><para>Applicable</para>
</entry><entry><para>Applicable</para>
</entry>
</row><row><entry><para>Aliases</para>
</entry><entry><para>N/A</para>
</entry><entry><para>Applicable</para>
</entry><entry><para>Applicable</para>
</entry>
</row><row><entry><para>Single-character abbreviation for login directory</para>
</entry><entry><para>N/A</para>
</entry><entry><para>Applicable</para>
</entry><entry><para>Applicable</para>
</entry>
</row><row><entry><para>Protection from overwriting (<literal>noclobber</literal>)</para>
</entry><entry><para>N/A</para>
</entry><entry><para>Applicable</para>
</entry><entry><para>Applicable</para>
</entry>
</row><row><entry><para>Setting to ignore Control-D <literal>(ignoreeof)</literal></para>
</entry><entry><para>N/A</para>
</entry><entry><para>Applicable</para>
</entry><entry><para>Applicable</para>
</entry>
</row><row><entry><para>Enhanced <command>cd</command> command</para>
</entry><entry><para>N/A</para>
</entry><entry><para>Applicable</para>
</entry><entry><para>Applicable</para>
</entry>
</row><row><entry><para>Initialization file separate from <filename>.profile</filename></para>
</entry><entry><para>N/A</para>
</entry><entry><para>Applicable</para>
</entry><entry><para>Applicable</para>
</entry>
</row><row><entry><para>Logout file</para>
</entry><entry><para>N/A</para>
</entry><entry><para>Applicable</para>
</entry><entry><para><indexterm id="userconcept-ix548"><primary>Bourne shell</primary><secondary>basic features</secondary></indexterm><indexterm id="userconcept-ix549"><primary>C shell</primary><secondary>basic features</secondary></indexterm><indexterm id="userconcept-ix551"><primary>shells</primary><secondary>basic features</secondary></indexterm>N/A</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="userconcept-26"><title>Shell Environment</title><para><indexterm id="userconcept-ix552"><primary>variables</primary><secondary>environment</secondary></indexterm><indexterm id="userconcept-ix553"><primary>shells</primary><secondary>environment variables and</secondary></indexterm><indexterm id="userconcept-ix554"><primary>shells</primary><secondary>environment of</secondary></indexterm><indexterm id="userconcept-ix555"><primary>environment variables</primary><secondary>description</secondary></indexterm>A shell maintains an environment
that includes a set of variables defined by the <command>login</command> program,
the system initialization file, and the user initialization files. In addition,
some variables are defined by default. </para><itemizedlist><para>A shell can have two types of variables: </para><listitem><para><indexterm id="userconcept-ix557"><primary>displaying</primary><secondary>environment variables</secondary></indexterm><indexterm id="userconcept-ix558"><primary><command>env</command> command</primary></indexterm><emphasis role="strong">Environment variables &ndash;</emphasis> Variables
that are exported to all processes spawned by the shell. Their settings can
be seen with the <command>env</command> command. A subset of environment variables,
such as <literal>PATH</literal>, affects the behavior of the shell itself.
 </para>
</listitem><listitem><para><indexterm id="userconcept-ix559"><primary>shells</primary><secondary>local variables</secondary></indexterm><indexterm><primary><literal>path</literal> shell variable</primary></indexterm><indexterm id="userconcept-ix566"><primary>variables</primary><secondary>shell (local)</secondary></indexterm><emphasis role="strong">Shell (local) variables &ndash;</emphasis> Variables that affect
only the current shell. In the C shell, a set of these shell variables have
a special relationship to a corresponding set of environment variables. These
shell variables are <literal>user</literal>, <literal>term</literal>, <literal>home</literal>, and <literal>path</literal>. The value of the environment variable
counterpart is initially used to set the shell variable.   </para>
</listitem>
</itemizedlist><para><indexterm id="userconcept-ix567"><primary><command>set</command> command</primary></indexterm><indexterm id="userconcept-ix568"><primary>C shell</primary><secondary>shell (local) variables and</secondary></indexterm><indexterm id="userconcept-ix569"><primary>C shell</primary><secondary>environment variables and</secondary></indexterm><indexterm id="userconcept-ix570"><primary><command>setenv</command> command</primary></indexterm>In the C shell, you use the lowercase
names with the <command>set</command> command to set shell variables. You
use uppercase names with the <command>setenv</command> command to set environment
variables. If you set a shell variable, the shell sets the corresponding environment
variable. Likewise, if you set an environment variable, the corresponding
shell variable is also updated. For example, if you update the <literal>path</literal> shell
variable with a new path, the shell also updates the <literal>PATH</literal> environment
variable with the new path.    </para><para>In the Bourne and Korn shells, you can use the uppercase variable name
equal to some value to set both shell and environment variables. You also
have to use the <command>export</command> command to activate the variables
for any subsequently executed commands.</para><para>For all shells, you generally refer to shell and environment variables
by their uppercase names. </para><para><indexterm id="userconcept-ix577"><primary>user initialization files</primary><secondary>customizing</secondary><tertiary>environment variables</tertiary></indexterm><indexterm id="userconcept-ix578"><primary>shells</primary><secondary>environment variables and</secondary></indexterm>In a user initialization
file, you can customize a user's shell environment by changing the values
of the predefined variables or by specifying additional variables. The following
table shows how to set environment variables in a user initialization file.
 </para><table frame="topbot" id="userconcept-23034"><title>Setting Environment Variables
in a User Initialization File</title><tgroup cols="2" colsep="0" rowsep="1"><colspec colname="column1" colwidth="198*"/><colspec colname="column2" colwidth="198*"/><thead><row><entry><para> Shell Type</para>
</entry><entry><para>Line to Add to the User Initialization File</para>
</entry>
</row>
</thead><tbody><row rowsep="0"><entry><para><indexterm id="userconcept-ix579"><primary>C shell</primary><secondary>shell (local) variables and</secondary></indexterm><indexterm id="userconcept-ix580"><primary>C shell</primary><secondary>environment variables and</secondary></indexterm>C shell  </para>
</entry><entry><para><indexterm id="userconcept-ix581"><primary><command>setenv</command> command</primary></indexterm><command>setenv</command> <replaceable>VARIABLE</replaceable> <replaceable>value</replaceable> </para><para><indexterm id="userconcept-ix582"><primary><literal>MAIL</literal> environment variable</primary></indexterm>Example: </para><para><command>setenv MAIL /var/mail/ripley</command></para>
</entry>
</row><row><entry><para>Bourne or Korn shell </para>
</entry><entry><para><replaceable>VARIABLE</replaceable><command>=</command><replaceable>value</replaceable><command>; export</command> <replaceable>VARIABLE</replaceable></para><para>Example:</para><para><command>MAIL=/var/mail/ripley;export MAIL</command></para>
</entry>
</row>
</tbody>
</tgroup>
</table><para><indexterm id="userconcept-ix588"><primary>user initialization files</primary><secondary>customizing</secondary><tertiary>shell variables</tertiary></indexterm><indexterm id="userconcept-ix589"><primary>shells</primary><secondary>local variables</secondary></indexterm><indexterm id="userconcept-ix590"><primary>shell variables</primary></indexterm>The following
table describes environment variables and shell variables that you might want
to customize in a user initialization file. For more information about variables
that are used by the different shells, see the <olink targetdoc="refman" targetptr="sh-1" remap="external"><citerefentry><refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>, <olink targetdoc="refman" targetptr="ksh-1" remap="external"><citerefentry><refentrytitle>ksh</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>,
or <olink targetdoc="refman" targetptr="csh-1" remap="external"><citerefentry><refentrytitle>csh</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man pages.</para><table frame="topbot" id="userconcept-25244"><title>Shell and Environment
Variable Descriptions</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="91*"/><colspec colname="column2" colwidth="305*"/><thead><row rowsep="1"><entry><para>Variable</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><indexterm id="userconcept-ix594"><primary><literal>CDPATH</literal> environment variable</primary></indexterm><literal>CDPATH</literal>, or <literal>cdpath</literal> in
the C shell  </para>
</entry><entry><para>Sets a variable used by the <command>cd</command> command. If the target
directory of the <command>cd</command> command is specified as a relative
path name, the <command>cd</command> command first looks for the target directory
in the current directory (&ldquo;.&rdquo;). If the target is not found, the
path names listed in the <literal>CDPATH</literal> variable are searched consecutively
until the target directory is found and the directory change is completed.
If the target directory is not found, the current working directory is left
unmodified. For example, the <literal>CDPATH</literal> variable is set to <filename>/home/jean</filename>, and two directories exist under <filename>/home/jean</filename>, <filename>bin</filename>, and <filename>rje</filename>. If you are in the <filename>/home/jean/bin</filename> directory and type <command>cd rje</command>, you change directories
to <filename>/home/jean/rje</filename>, even though you do not specify a full
path.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix597"><primary><literal>history</literal> environment variable</primary></indexterm><literal>history</literal> </para>
</entry><entry><para>Sets the history for the C shell.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix599"><primary><literal>HOME</literal> environment variable</primary></indexterm><literal>HOME</literal>, or <literal>home</literal> in
the C shell</para>
</entry><entry><para>Sets the path to the user's home directory.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix600"><primary><literal>locale</literal> environment variable</primary></indexterm><indexterm id="userconcept-ix601"><primary><literal>LANG</literal> environment variable</primary></indexterm><literal>LANG</literal>  </para>
</entry><entry><para>Sets the locale.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix602"><primary><literal>LOGNAME</literal> environment variable</primary></indexterm><literal>LOGNAME</literal> </para>
</entry><entry><para><indexterm id="userconcept-ix603"><primary>environment variables</primary><secondary><literal>LOGNAME</literal> </secondary></indexterm>Defines the
name of the user currently logged in. The default value of <literal>LOGNAME</literal> is
set automatically by the login program to the user name specified in the <filename>passwd</filename> file. You should only need to refer to, not reset, this
variable. </para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix604"><primary><literal>LPDEST</literal> environment variable</primary></indexterm><indexterm id="userconcept-ix606"><primary>environment variables</primary><secondary><literal>LPDEST</literal></secondary></indexterm><literal>LPDEST</literal>  </para>
</entry><entry><para>Sets the user's default printer.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix607"><primary><literal>MAIL</literal> environment variable</primary></indexterm><literal>MAIL</literal> </para>
</entry><entry><para>Sets the path to the user's mailbox.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix608"><primary><literal>MANPATH</literal> environment variable</primary></indexterm><literal>MANPATH</literal> </para>
</entry><entry><para>Sets the hierarchies of man pages that are available.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix611"><primary><literal>PATH</literal> environment variable</primary><secondary>description</secondary></indexterm><indexterm id="userconcept-ix612"><primary>directories</primary><secondary><literal>PATH</literal> environment variable and</secondary></indexterm><literal>PATH</literal>, or <literal>path</literal> in
the C shell  </para>
</entry><entry><para>Specifies, in order, the directories that the shell searches to find
the program to run when the user types a command. If the directory is not
in the search path, users must type the complete path name of a command. </para><para><indexterm id="userconcept-ix615"><primary>environment variables</primary><secondary><literal>PATH</literal></secondary></indexterm>As part of the login
process, the default <literal>PATH</literal> is automatically defined and
set as specified in <filename>.profile</filename> (Bourne or Korn shell) or <filename>.cshrc</filename> (C shell). </para><para>The order of the search path is important. When identical commands exist
in different locations, the first command found with that name is used. For
example, suppose that <literal>PATH</literal> is defined in Bourne and Korn
shell syntax as <literal>PATH=/bin:/usr/bin:/usr/sbin:$HOME/bin</literal> and
a file named <filename>sample</filename> resides in both <filename>/usr/bin</filename> and <filename>/home/jean/bin</filename>. If the user types the command <command>sample</command> without
specifying its full path name, the version found in <filename>/usr/bin</filename> is
used.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix616"><primary><literal>prompt</literal> shell variable</primary></indexterm><literal>prompt</literal> </para>
</entry><entry><para>Defines the shell prompt for the C shell.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix617"><primary><literal>PS1</literal> environment variable</primary></indexterm><literal>PS1</literal> </para>
</entry><entry><para>Defines the shell prompt for the Bourne or Korn shell.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix618"><primary>environment variables</primary><secondary><literal>SHELL</literal></secondary></indexterm><indexterm id="userconcept-ix620"><primary><literal>SHELL</literal> environment variable</primary></indexterm><literal>SHELL</literal>, or <literal>shell</literal> in the C
shell   </para>
</entry><entry><para>Sets the default shell used by <command>make</command>, <command>vi</command>,
and other tools.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix622"><primary><literal>TERMINFO</literal> environment variable</primary></indexterm><literal>TERMINFO</literal> </para>
</entry><entry><para>Specifies the path name for an unsupported terminal that has been added
to the <filename>terminfo</filename> file. Use the <literal>TERMINFO</literal> variable
in either the <filename>/etc/profile</filename> or <filename>/etc/.login</filename> file. </para><para></para><para>When the <literal>TERMINFO</literal> environment variable is set, the
system first checks the <literal>TERMINFO</literal> path defined by the user.
If the system does not find a definition for a terminal in the <literal>TERMINFO</literal> directory
defined by the user, it searches the default directory, <filename>/usr/share/lib/terminfo</filename>, for a definition. If the system does not find a definition in
either location, the terminal is identified as &ldquo;dumb.&rdquo;</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix623"><primary><literal>TERM</literal> environment variable</primary></indexterm><literal>TERM</literal>, or term in the C shell
 </para>
</entry><entry><para>Defines the terminal. This variable should be reset in either the <filename>/etc/profile</filename> or <filename>/etc/.login</filename> file. When the
user invokes an editor, the system looks for a file with the same name that
is defined in this environment variable. The system searches the directory
referenced by <literal>TERMINFO</literal> to determine the terminal characteristics.</para>
</entry>
</row><row><entry><para><indexterm id="userconcept-ix625"><primary><literal>TZ</literal> environment variable</primary></indexterm><indexterm id="userconcept-ix626"><primary>time zone environment variable</primary></indexterm><literal>TZ</literal>  </para>
</entry><entry><para><indexterm id="userconcept-ix627"><primary>environment variables</primary><secondary><literal>TZ</literal></secondary></indexterm><indexterm id="userconcept-ix628"><primary>user initialization files</primary><secondary>customizing</secondary><tertiary>shell variables</tertiary></indexterm>Sets the time
zone. The time zone is used to display dates, for example, in the <command>ls
-l</command>  command. If <literal>TZ</literal> is not set in the user's environment,
the system setting is used. Otherwise, Greenwich Mean Time is used.  </para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="userconcept-39855"><title>The <literal>PATH</literal> Variable</title><para><indexterm id="userconcept-ix637"><primary><literal>PATH</literal> environment variable</primary><secondary>description</secondary></indexterm><indexterm id="userconcept-ix638"><primary>directories</primary><secondary><literal>PATH</literal> environment variable and</secondary></indexterm>When the user executes a command by using
the full path, the shell uses that path to find the command. However, when
users specify only a command name, the shell searches the directories for
the command in the order specified by the <literal>PATH</literal> variable.
If the command is found in one of the directories, the shell executes the
command.  </para><para>A default path is set by the system. However, most users modify it to
add other command directories. Many user problems related to setting up the
environment and accessing the correct version of a command or a tool can be
traced to incorrectly defined paths.</para><sect3 id="userconcept-21"><title>Setting Path Guidelines</title><itemizedlist><para>Here are some guidelines for setting up efficient <literal>PATH</literal> variables: </para><listitem><para>If security is not a concern, put the current working directory
(.) first in the path. However, including the current working directory in
the path poses a security risk that you might want to avoid, especially for
superuser. </para>
</listitem><listitem><para>Keep the search path as short as possible. The shell searches
each directory in the path. If a command is not found, long searches can slow
down system performance.</para>
</listitem><listitem><para>The search path is read from left to right, so you should
put directories for commonly used commands at the beginning of the path.</para>
</listitem><listitem><para>Make sure that directories are not duplicated in the path.</para>
</listitem><listitem><para>Avoid searching large directories, if possible. Put large
directories at the end of the path.</para>
</listitem><listitem><para>Put local directories before NFS mounted directories to lessen
the chance of &ldquo;hanging&rdquo; when the NFS server does not respond.
This strategy also reduces unnecessary network traffic.</para>
</listitem>
</itemizedlist>
</sect3><sect3 id="userconcept-22"><title>Setting a User's Default Path</title><para>This is an example of how to set a user's default path.</para><para><indexterm id="userconcept-ix641"><primary>environment variables</primary><secondary><literal>PATH</literal> </secondary></indexterm><indexterm id="userconcept-ix642"><primary>directories</primary><secondary><literal>PATH</literal> environment variable and</secondary></indexterm><indexterm id="userconcept-ix643"><primary><literal>PATH</literal> environment variable</primary><secondary>setting up</secondary></indexterm>The following examples show how to set a user's default path to
include the home directory and other NFS mounted directories. The current
working directory is specified first in the path. In a C-shell user initialization
file, you would add the following: </para><screen>set path=(. /usr/bin $HOME/bin /net/glrr/files1/bin)</screen><para>In a Bourne-shell or Korn-shell user initialization file, you would
add the following:</para><screen>PATH=.:/usr/bin:/$HOME/bin:/net/glrr/files1/bin
export PATH</screen>
</sect3>
</sect2><sect2 id="userconcept-23"><title>Locale Variables</title><para><indexterm id="userconcept-ix644"><primary><literal>LC</literal> environment variables</primary></indexterm><indexterm id="userconcept-ix645"><primary><literal>LANG</literal> environment variable</primary></indexterm><indexterm id="userconcept-ix646"><primary><command>stty</command> command</primary></indexterm>The <literal>LANG</literal> and <literal>LC</literal> environment
variables specify the locale-specific conversions and conventions for the
shell. These conversions and conventions include time zones, collation orders,
and formats of dates, time, currency, and numbers. In addition, you can use
the <command>stty</command> command in a user initialization file to indicate
whether the terminal session will support multibyte characters.   </para><para>The <literal>LANG</literal> variable sets all possible conversions and
conventions for the given locale. You can set various aspects of localization
separately through these <literal>LC</literal> variables: <literal>LC_COLLATE</literal>, <literal>LC_CTYPE</literal>, <literal>LC_MESSAGES</literal>, <literal>LC_NUMERIC</literal>, <literal>LC_MONETARY</literal>, and <literal>LC_TIME</literal>.</para><para>The following table describes some of the values for the <literal>LANG</literal> and <literal>LC</literal> environment variables.</para><table frame="topbot" id="userconcept-26294"><title>Values for <literal>LANG</literal> and <literal>LC</literal> Variables</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="119*"/><colspec colname="column2" colwidth="277*"/><thead><row rowsep="1"><entry><para>Value</para>
</entry><entry><para>Locale</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>de_DE.ISO8859-1</literal></para>
</entry><entry><para><literal>German</literal></para>
</entry>
</row><row><entry><para><literal>en_US.UTF-8</literal></para>
</entry><entry><para><literal>American English</literal> (UTF-8)</para>
</entry>
</row><row><entry><para><literal>es_ES.ISO8859-1</literal></para>
</entry><entry><para><literal>Spanish</literal></para>
</entry>
</row><row><entry><para><literal>fr_FR.ISO8859-1</literal></para>
</entry><entry><para><literal>French</literal></para>
</entry>
</row><row><entry><para><literal>it_IT.ISO8859-1</literal> </para>
</entry><entry><para><literal>Italian</literal></para>
</entry>
</row><row><entry><para><literal>ja_JP.eucJP</literal></para>
</entry><entry><para><literal>Japanese</literal> (EUC)</para>
</entry>
</row><row><entry><para><literal>ko_KR.EUC</literal></para>
</entry><entry><para><literal>Korean</literal> (EUC)</para>
</entry>
</row><row><entry><para><literal>sv_SE.ISO8859-1</literal></para>
</entry><entry><para><literal>Swedish</literal></para>
</entry>
</row><row><entry><para><literal>zh_CN.EUC</literal></para>
</entry><entry><para><literal>Simplified Chinese</literal> (EUC)</para>
</entry>
</row><row><entry><para><literal>zh_TW.EUC</literal></para>
</entry><entry><para><literal>Traditional Chinese</literal> (EUC)</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>For more information on supported locales, see the <citetitle>International
Language Environments Guide</citetitle>.</para><example id="userconcept-24"><title>Setting the Locale Using the <literal>LANG</literal> Variables</title><para><indexterm id="userconcept-ix648"><primary>C shell</primary><secondary>environment variables and</secondary></indexterm><indexterm id="userconcept-ix649"><primary><literal>LANG</literal> environment variable</primary></indexterm><indexterm id="userconcept-ix650"><primary><literal>LC</literal> environment variables</primary></indexterm><indexterm id="userconcept-ix651"><primary>environment variables</primary><secondary>description</secondary></indexterm><indexterm id="userconcept-ix652"><primary>variables</primary><secondary>environment</secondary></indexterm><indexterm id="userconcept-ix655"><primary>shells</primary><secondary>environment variables and</secondary></indexterm><indexterm id="userconcept-ix656"><primary>user initialization files</primary><secondary>customizing</secondary><tertiary>environment variables</tertiary></indexterm>The following examples show how to set the
locale by using the <literal>LANG</literal> environment variables. In a C-shell
user initialization file, you would add the following:</para><screen>setenv LANG de_DE.ISO8859-1</screen><para>In a Bourne-shell or Korn-shell user initialization file, you would
add the following:</para><screen>LANG=de_DE.ISO8859-1; export LANG</screen>
</example>
</sect2><sect2 id="userconcept-95347"><title>Default File Permissions (<command>umask</command>)</title><para><indexterm id="userconcept-ix657"><primary>files</primary><secondary>controlling access to</secondary></indexterm><indexterm id="userconcept-ix658"><primary>directories</primary><secondary>controlling access to</secondary></indexterm><indexterm id="userconcept-ix660"><primary>controlling file and directory access</primary></indexterm><indexterm id="userconcept-ix661"><primary>user initialization files</primary><secondary>customizing</secondary><tertiary>user mask setting</tertiary></indexterm><indexterm id="userconcept-ix663"><primary>permissions</primary></indexterm><indexterm id="userconcept-ix664"><primary>user mask</primary></indexterm><indexterm id="userconcept-ix665"><primary>displaying</primary><secondary>user mask</secondary></indexterm><indexterm id="userconcept-ix666"><primary><command>umask</command> command</primary></indexterm>When you create
a file or directory, the default file permissions assigned to the file or
directory are controlled by the <emphasis>user mask</emphasis>. The user mask
is set by the <command>umask</command> command in a user initialization file.
You can display the current value of the user mask by typing <command>umask</command> and
pressing Return.        </para><itemizedlist><para>The user mask contains the following octal values:</para><listitem><para>The first digit sets permissions for the user</para>
</listitem><listitem><para>The second digit sets permissions for group</para>
</listitem><listitem><para>The third digit sets permissions for other, also referred
to as <literal>world</literal></para>
</listitem>
</itemizedlist><para>Note that if the first digit is zero, it is not displayed. For example,
if the user mask is set to 022, 22 is displayed.</para><para>To determine the <command>umask</command> value you want to set, subtract
the value of the permissions you want from 666 (for a file) or 777 (for a
directory). The remainder is the value to use with the <command>umask</command> command.
For example, suppose you want to change the default mode for files to 644
(<command>rw-r--r--</command>). The difference between 666 and 644 is 022,
which is the value you would use as an argument to the <command>umask</command> command.</para><para>You can also determine the <command>umask</command> value you want to
set by using the following table. This table shows the file and directory
permissions that are created for each of the octal values of <command>umask</command>.</para><table frame="topbot" id="userconcept-86325"><title>Permissions for <command>umask</command> Values</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="125*"/><colspec colname="column2" colwidth="125*"/><colspec colname="column3" colwidth="146*"/><thead><row rowsep="1"><entry><para><command>umask</command> Octal Value</para>
</entry><entry><para>File Permissions</para>
</entry><entry><para>Directory Permissions</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>0</literal></para>
</entry><entry><para><literal>rw-</literal></para>
</entry><entry><para><literal>rwx</literal></para>
</entry>
</row><row><entry><para><literal>1</literal></para>
</entry><entry><para><literal>rw-</literal></para>
</entry><entry><para><literal>rw-</literal></para>
</entry>
</row><row><entry><para><literal>2</literal></para>
</entry><entry><para><literal>r--</literal></para>
</entry><entry><para><literal>r-x</literal></para>
</entry>
</row><row><entry><para><literal>3</literal></para>
</entry><entry><para><literal>r--</literal></para>
</entry><entry><para><literal>r--</literal></para>
</entry>
</row><row><entry><para><literal>4</literal></para>
</entry><entry><para><literal>-w-</literal></para>
</entry><entry><para><literal>-wx</literal></para>
</entry>
</row><row><entry><para><literal>5</literal></para>
</entry><entry><para><literal>-w-</literal></para>
</entry><entry><para><literal>-w-</literal></para>
</entry>
</row><row><entry><para><literal>6</literal></para>
</entry><entry><para><literal>--x</literal></para>
</entry><entry><para><literal>--x</literal></para>
</entry>
</row><row><entry><para><literal>7</literal></para>
</entry><entry><para><literal>---</literal> (none)</para>
</entry><entry><para><literal>---</literal> (none)</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>The following line in a user initialization file sets the default file
permissions to <literal>rw-rw-rw-</literal>.</para><screen>umask 000</screen>
</sect2><sect2 id="userconcept-12669"><title>User and Site Initialization Files Examples</title><para><indexterm id="userconcept-ix670"><primary>user initialization files</primary><secondary>examples</secondary></indexterm>The following sections provide
examples of user and site initialization files that you can use to start customizing
your own initialization files. These examples use system names and paths that
you need to change for your particular site. </para><example id="userconcept-25"><title>The <filename>.profile</filename> File</title><indexterm id="userconcept-ix671"><primary>user initialization files</primary><secondary>customizing</secondary>
</indexterm><indexterm id="userconcept-ix673"><primary>C shell</primary><secondary>user initialization files and</secondary>
</indexterm><indexterm id="userconcept-ix674"><primary><filename>.cshrc</filename> file</primary><secondary sortas="cshrc file">customizing</secondary>
</indexterm><indexterm id="userconcept-ix676"><primary><filename>.login</filename> file</primary><secondary sortas="login file">customizing</secondary>
</indexterm><indexterm id="userconcept-ix677"><primary><filename>.profile</filename> file</primary><secondary sortas="profile file">customizing</secondary>
</indexterm><indexterm id="userconcept-ix678"><primary>shells</primary><secondary>user initialization files and</secondary>
</indexterm><indexterm id="userconcept-ix679"><primary>user initialization files</primary><secondary>shells and</secondary>
</indexterm><screen><lineannotation>(Line 1)</lineannotation> PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/ccs/bin:. 
<lineannotation>(Line 2)</lineannotation> MAIL=/var/mail/$LOGNAME 
<lineannotation>(Line 3)</lineannotation> NNTPSERVER=server1 
<lineannotation>(Line 4)</lineannotation> MANPATH=/usr/share/man:/usr/local/man 
<lineannotation>(Line 5)</lineannotation> PRINTER=printer1 
<lineannotation>(Line 6)</lineannotation> umask 022 
<lineannotation>(Line 7)</lineannotation> export PATH MAIL NNTPSERVER MANPATH PRINTER</screen><orderedlist><listitem><para>Defines the user's shell search path</para>
</listitem><listitem><para>Defines the path to the user's mail file</para>
</listitem><listitem><para>Defines the user's Usenet news server</para>
</listitem><listitem><para>Defines the user's search path for man pages</para>
</listitem><listitem><para>Defines the user's default printer</para>
</listitem><listitem><para>Sets the user's default file creation permissions</para>
</listitem><listitem><para>Sets the listed environment variables</para>
</listitem>
</orderedlist>
</example><example id="userconcept-25815"><title>The <filename>.cshrc</filename> File</title><screen><lineannotation>(Line 1)</lineannotation> set path=($PATH $HOME/bin /usr/local/bin /usr/ccs/bin)
<lineannotation>(Line 2)</lineannotation> setenv MAIL /var/mail/$LOGNAME 
<lineannotation>(Line 3)</lineannotation> setenv NNTPSERVER server1 
<lineannotation>(Line 4)</lineannotation> setenv PRINTER printer1 
<lineannotation>(Line 5)</lineannotation> alias h history 
<lineannotation>(Line 6)</lineannotation> umask 022 
<lineannotation>(Line 7)</lineannotation> source /net/server2/site-init-files/site.login </screen><orderedlist><listitem><para>Defines the user's shell search path.</para>
</listitem><listitem><para>Defines the path to the user's mail file.</para>
</listitem><listitem><para>Defines the user's Usenet news server.</para>
</listitem><listitem><para>Defines the user's default printer.</para>
</listitem><listitem><para>Creates an alias for the <command>history</command> command.
The user needs to type only <command>h</command> to run the <command>history</command> command.</para>
</listitem><listitem><para>Sets the user's default file creation permissions.</para>
</listitem><listitem><para>Sources the site initialization file.</para>
</listitem>
</orderedlist>
</example><example id="userconcept-38844"><title>Site Initialization File</title><para>The following shows an example site initialization file in which a user
can choose a particular version of an application. </para><programlisting role="complete"># @(#)site.login
main: 
echo "Application Environment Selection"
echo ""
echo "1. Application, Version 1"
echo "2. Application, Version 2"
echo "" 
echo -n "Type 1 or 2 and press Return to set your 
application environment: " 

set choice = $&lt;	

if ( $choice !~ [1-2] ) then 
goto main 
endif 

switch ($choice) 

case "1": 
setenv APPHOME /opt/app-v.1 
breaksw 

case "2": 
setenv APPHOME /opt/app-v.2 
endsw</programlisting><para>This site initialization file could be referenced in a user's <filename>.cshrc</filename> file (C shell users only) with the following line:</para><screen>source /net/server2/site-init-files/site.login</screen><para>In this line, the site initialization file is named <filename>site.login</filename> and
is located on a server named <literal>server2</literal>. This line also assumes
that the automounter is running on the user's system.</para>
</example>
</sect2>
</sect1>
</chapter><?Pub *0000120631 0?>