Introduction

Introduction

The concept of a user on a Linux system is fairly rigidly defined and more numeric than you might think. At the login prompt, you type in some string of characters (e.g., shawkins or root) called your user name. The system takes this string, compares it to the entries in the /etc/passwd file, and finds the encrypted password associated with that user. It then prompts you for a password. Whatever string you type in is encrypted, and the result of the encryption is compared with the password string stored in /etc/ passwd. If the strings match, the system acknowledges your right to log in.

The login program sets your user id and group id and forks (creates a copy of itself); then, the copy turns into whatever shell is specified as your preference in /etc/passwd. That shell is told that its current working directory is whatever file specified as your home directory in the (can you guess?) /etc/passwd file.

Your, account's existence on the system is largely defined by two numbers: your user id (uid) and group id (gid). These two numbers are how the system thinks of you; they are found in the inodes of your files, in the innermost recesses of the kernel's CPU allocation algorithms, and in the processes you run. The user and group names that one typically sees when running commands (ls, ps, etc.) are looked up in /etc/passwd file, as necessary. The system doesn't care about names.

Entries in the /etc/passwd file are of the following format:

name:encrypted_password:UID:GID:user name:home_directory:shell

Your primary group is specified in /etc/passwd. However, you can belong to more than one group. Groups and their membership are defined in the file /etc/group.

Various program exist to display your current set of user attributes and allow you to modify them.

chfn

Change information displayed by finger.

chpasswd

Change user passwords in bulk.

finger

Display information about a user.

groupmod

Modify information in the system group files.

grpck

Check system group files for validity.

groups

Display group information for a user.

id

Display information about a user.

passwd

Change a user's password.

pwck

Check system password files for validity.

su

Change to a new user id.

useradd

Add a new user to the system.

userdel

Delete a user from the system.

usermod

Modify user information on the system.

users

Display a list of current users.

who

Display a list of current users.

 



Linux Desk Reference
Linux Desk Reference (2nd Edition)
ISBN: 0130619892
EAN: 2147483647
Year: 2000
Pages: 174
Authors: Scott Hawkins

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