Previous Table of Contents Next


As you can see, these files define a minimal t environment. To minimize the need to edit the customization files for each user, you can customize the files in /etc/skel to set as many systemwide default variables as you can. You will need to edit individual users' customization files to set the user's path.

To set up initialization files, you must already have created the user's home directory and know which shell (C, Bourne, or Korn) is set in the user's account entry in the Passwd database. Follow these steps to set up the user's initialization files:

1.  Become superuser on the system with the user's home directory.
2.  Type cd /home-dir/login-name and press Return. You are in the user's home directory. For example to change to user ignatz's directory which is in /export/home1, type: # cd /export/home1/ignatz.
3.  Type cp /etc/skel/local.* . and press Return. You have copied all of the default user initialization files to the user's home directory.
4.  Type chmod 744 local.* and press Return. Permissions are set for the initialization files.
5.  Type chown login-name * and press Return. The user now owns the initialization files:
# chown ignatz *
#
6.  Type chgrp primary-GIDlocal.* and press Return. The files are assigned to the primary group (for example, sysadmin) you specified in the Passwd database for the user account:
# chgrp 1Ø local.*
#
7.  Rename the shell initialization files. If the user's shell is the C shell, type mv local.login .login; mv local.cshrc .cshrc and press Return. If the user's shell is the Korn or Bourne shell, type mv local.profile .profile and press Return.
8.  Type rm local.* and press Return. You have removed the unused shell initialization files.
9.  Mount the user's home directory.
10.  On the user's system, log in as the user.
11.  Assign the t user an interim password. See "Creating a Password" later in the chapter for information on how to create passwords.
12.  Check to make sure the user's environment is set up correctly.
13.  Edit the user's initialization file (or files) and make changes as needed.

To edit the user's initialization file (or files):

1.  Set the user's default path to include the home directory and directories or mount points for the user's windowing environment and applications.
2.  To change the path setting, add or modify the line for PATH as follows. For the C shell, type set path =(. /dirname1 /dirname2 /dirname3 ...). For example, enter a line like this in the user's $HOME/.cshrc file:
set path=(. /usr/openwin/bin /usr/dt/bin /usr/bin /$home/bin /lib
/usr/lib)

For the Bourne or Korn shell, type PATH=.:/dirname1:/dirname2: / dirname3 ...;export PATH. For example, enter a line such as the following in the user's $HOME/.profile file:
PATH=.:/usr/openwin/bin:/usr/dt/bin /usr/bin:/$HOME/bin:/lib:/
usr/lib;
export PATH
3.  To check that the environment variables are set correctly, type env and press Return. Note that the variables are shown using Bourne or Korn shell syntax, even if the user's shell is the C shell. Type man =s5 environ and press Return for more information:
$ env
HOME=/home/ignatz
HZ=1ØØ
LOGNAME=ignatz
MAIL=/var/mail/ignatz
MANSECTS=1:1m:1c:1f:1s:1b:2:3:3c:3i:3n:3m:3k:3g:3e:3x11:3xt:3w:3b:
9:4:5:7:8
PATH=:/usr/openwin/bin:/sbin:/usr/sbin:/usr/bin:/etc:/$HOME/bin:/lib:
/usr/lib
SHELL=/bin/sh
TERM=sun
TZ=EST5EDT
$
4.  Add or change the settings of environment variables. For the C shell, type setenv VARIABLE value (or set variable=value for the path and term variables). For example, this line sets the history to the last 100 commands:
setenv HISTORY 100

For the Bourne or Korn shell, type VARIABLE=value;export VARIABLE. For example, this line sets the user's default mail directory:
MAIL=/var/mail/ignatz;export MAIL
5.  Check the umask setting. If you need to change it, type umask nnn and press Return. You can either includet or omit leading zeros. For example, to set file permissions to 644, type umask 022. Table 7-8 shows the file permissions that are created for each of the octal values of umask.
Table 7-8 Permissions for umask Values

Octal Value File Permissions
0 rwx
1 rw -
2 r-x
3 r - -
4 - wx
5 - w -
6 - - x
7 - - -(none)

The LANG variable and LC environment variables determine the locale-specific conversions and conventions the shell uses. These conversions and conventions include time zones, collation orders, and formats of dates, time, currency, and numbers. If necessary, set these variables in the user's initialization file. LANG sets all possible conversions and conventions for a given locale. If you have special needs, you can set various aspects of localization separately using the LC variables LC_COLLATE, LC_CTYPE,

LC_MESSAGES, and LC_NUMERIC. Table 7-9 shows the values for several locales.

If the system needs to support multibyte characters (for example, Japanese), add this command to the system initialization file (/etc /profile or /etc /.login): stty cs8 defeucw. When the initialization files are complete, log out of the user's account.

Table 7-9 Values for LANG and LC Variables

Value Locale
de: German
fr: French
iso_8895_1 English and European
it Italian
japanese Japanese
korean Korean
sv Swedish
tchinese Taiwanese


Previous Table of Contents Next