Two-Minute Drill


Basics of User Accounts

A user account has the following components:

q  

User login name. It must be two to eight characters long, may contain letters and numerals, must begin with a letter, and must contain at least one lowercase letter.

q  

Password. It can be two to six characters long by default, and the first six characters must contain at least one numeric or special character and at least two letters. The default minimum (2) and maximum (6) length can be changed by editing the files /etc/default/passwd and /etc/policy, respectively.

q  

UID. This is a signed 32-bit positive integer associated with each user: 0–99 for system accounts, 100–60,000 for regular users, and higher numbers for accounts with incomplete functionality.

q  

Home directory. This makes the root of the directory subtree that belongs to the user. The path to the user home directory is included in the user's entry into the /etc/passwd file.

q  

Group name and GID. Multiple users can be logically organized into a group to share resources on the system. Each group has a group name, a group ID (GID), and a list of users that belong to the group.

The /etc/default/passwd file can also be used to change other default settings for the password such as the history parameter, which specifies how many previous passwords should be remembered so that a user cannot change the password to one of those. This is a security feature to prevent reusing recently used passwords. You will learn more about this file in the next chapter, in which we discuss security.

Managing User Accounts

q  

You can create new user accounts by issuing the useradd command. For example, the following command will create the user account with account name jkerry, primary group dems, and the default home directory /home/jkerry, which will be created if it does not exist:

    useradd -g dems -m jkerry 

q  

The useradd command can also be used to change the default value of an option; for example, the following command will change the default value for a base directory (/home) to /home/export:

    useradd -D -b /home/export 

q  

You can modify an existing account by issuing the usermod command. The same set of options is available to both the useradd and the usermod commands; for example, the following command will assign a secondary group senate to the user jkerry, and will set the expiration date 2 November 2008 on the account;

    usermod -G senate -e 11/2/2008 jkerry 

q  

You can delete an account by issuing the userdel command. For example, the following command will delete the user account jkerry along with its home directory:

    userdel -r jkerry 

q  

You can create, modify, and delete the groups by using the groupadd, groupmod, and groupdel commands, respectively.

q  

Each entry in the /etc/passwd file contains information about a user account: login name, place holder for encrypted password, UID, GID, comment, home directory, and login shell.

q  

Each entry in the /etc/shadow file contains information about a user account: login name, UID, encrypted password, minimum number of days required between password changes, maximum number of days before the user will be forced to change the password, number of days before the password expiration date when the user starts getting warnings, number of days the account can be inactive before it will be locked, and the account expiration date.

q  

Each entry in the /etc/group file contains information about a group: group name, group password, GID, and the list of group members.

Shell Initialization Files

The following initialization files are used to set up the working environment for the user:

q  

Bourne shell. The /etc/profile site initialization file, which will be executed first, followed by the execution of the $HOME/.profile, which the user can customize.

q  

Korn shell. The /etc/profile site initialization file, which will be executed first, followed by the execution of the $HOME/.profile and $HOME/.kshrc, which the user can customize.

q  

C shell. The /etc/.login site initialization file, which will be executed first, followed by the execution of the $HOME/.login and /$HOME/.cshrc, which the user can. customize.




Sun Certified System Administrator for Solaris 10 Study Guide Exams 310-XXX & 310-XXX
Sun Certified System Administrator for Solaris 10 Study Guide Exams 310-XXX & 310-XXX
ISBN: N/A
EAN: N/A
Year: 2005
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net