Sun Microsystems Logo
Products & Services
 
Support & Training
 
 

Previous Previous     Contents     Index     Next Next

Fields in the group File

The fields in the group file are separated by colons and contain the following information:

group-name:group-password:gid:user-list

For example:

bin::2:root,bin,daemon

The following table describes the group file fields.

Table 4-14 Fields in the group File

Field Name

Description

group-name

Contains the name assigned to the group. For example, members of the chemistry department in a university might be called chem. Group names can have a maximum of eight characters.

group-password

Usually contains an asterisk or is empty. The group-password field is a relic of earlier versions of UNIX. If a group has a password, the newgrp command prompts users to enter the password. However, no utility exists to set the password.

gid

Contains the group's GID number. It must be unique on the local system, and should be unique across the entire organization. Each GID number must be a whole number between 0 and 60002. Numbers under 100 are reserved for system default group accounts. User defined groups can range from 100 to 60000. 60001 and 60002 are reserved and assigned to nobody and noaccess, respectively.

user-list

Contains a comma-separated list of user names, representing the user's secondary group memberships. Each user can belong to a maximum of 15 secondary groups.

Default group file

The default Solaris group file contains the following system groups that support some system-wide task, such as printing, network administration, and electronic mail. Many of these groups having corresponding entries in the passwd file.

root::0:root
other::1:
bin::2:root,bin,daemon
sys::3:root,bin,sys,adm
adm::4:root,adm,daemon
uucp::5:root,uucp
mail::6:root
tty::7:root,adm
lp::8:root,lp,adm
nuucp::9:root,nuucp
staff::10:
daemon::12:root,daemon
smmsp::25:smmsp
sysadmin::14:root
nobody::60001:
noaccess::60002:
nogroup::65534:

Table 4-15 Default group File Entries

Group Name

Group ID

Description

root

0

Superuser group.

other

1

Optional group.

bin

2

Administrative group associated with running system binaries.

sys

3

Administrative group associated with system logging or temporary directories.

adm

4

Administrative group associated with system logging.

uucp

5

Group associated with uucp functions.

mail

6

Electronic mail group.

tty

7

Group associated with tty devices.

lp

8

Line printer group.

nuucp

9

Group associated with uucp functions.

staff

10

General administrative group.

daemon

12

Group associated with routine system tasks.

sysadmin

14

Administrative group associated with Admintool and Solstice AdminSuite tools.

smmsp

25

Sendmail message submission program daemon.

nobody

60001

Group assigned to users or software processes that do not need nor should have any special permissions.

noaccess

60002

Group assigned to a user or a process that needs access to a system through some application but without actually logging in.

nogroup

65534

Group assigned to a user who not a member of a known group.

Customizing a User's Work Environment

Part of setting up a user's home directory is providing user initialization files for the user's login shell. A user initialization file 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, its 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.

Table 4-16 User Initialization Files for Bourne, C, and Korn Shells

Shell

User Initialization File

Purpose

Bourne

$HOME/.profile

Defines user's environment at login

C

$HOME/.cshrc

Defines user's environment for all C shells and is invoked after login shell

 

$HOME/.login

Defines user's environment at login

 

Korn

$HOME/.profile

Defines user's environment at login

 

$HOME/$ENV

Defines user's environment at login in the file and is specified by the Korn shell's ENV environment variable

The Solaris environment provides default user initialization files for each shell in the /etc/skel directory on each system, as shown in the following table.

Table 4-17 Default User Initialization Files

Shell

Default File

C

/etc/skel/local.login

 

/etc/skel/local.cshrc

Bourne or Korn

/etc/skel/local.profile

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 them to provide the working environment for different types of users. For step-by-step instructions on how to create sets of user initialization files for different types of users, see How to Customize User Initialization Files.

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:

Shell

Files Created

C

The /etc/skel/local.cshrc and the /etc/skel/local.login files are copied into the user's home directory and are renamed .cshrc and .login.

Bourne and Korn

The /etc/skel/local.profile file is copied into the user's home directory and renamed .profile.

If you use the useradd command to add a new user account and specify the /etc/skel directory by using the -k and -m options, all three /etc/skel/local* and /etc/skel/.profile files are copied into the user's home directory. At this point, you will need to rename them to whatever is appropriate for the user's login shell.

Using Site Initialization Files

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 site initialization files. 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.

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.

Any customization that can be done in a user initialization file can be done in a site 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.

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:

source /net/machine-name/export/site-files/site-init-file

To reference a site initialization file in a Bourne- or Korn-shell user initialization file, place a line similar to the following at the beginning of the user initialization file:

. /net/machine-name/export/site-files/site-init-file

Avoid Local System References

You should not add specific references to the local system in the user's initialization file. You want the instructions in a user initialization file to be valid regardless of the system to which the user logs in. For example:

  • To make a user's home directory available anywhere on the network, always refer to the home directory with the variable $HOME. For example, use $HOME/bin instead of /export/home/username/bin. $HOME works when the user logs in to another system and the home directories are automounted.

  • To access files on a local disk, use global path names, like /net/system-name/directory-name. Any directory referenced by /net/system-name can be mounted automatically on any system on which the user logs in, assuming the system is running AutoFS.

Shell Features

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.

Table 4-18 Basic Features of Bourne, C, and Korn Shells

Feature

Bourne

C

Korn

Known as the standard shell in UNIX

Yes

No

No

Compatible syntax with Bourne shell

-

No

Yes

Job control

Yes

Yes

Yes

History list

No

Yes

Yes

Command-line editing

No

Yes

Yes

Aliases

No

Yes

Yes

Single-character abbreviation for login directory

No

Yes

Yes

Protection from overwriting (noclobber)

No

Yes

Yes

Setting to ignore Control-d (ignoreeof)

No

Yes

Yes

Enhanced cd

No

Yes

Yes

Initialization file separate from .profile

No

Yes

Yes

Logout file

No

Yes

No

Previous Previous     Contents     Index     Next Next