62
Linux+ Guide to Linux Certification Chapter Twelve Common Administrative Tasks

Chapter Twelve

  • Upload
    zhen

  • View
    44

  • Download
    0

Embed Size (px)

DESCRIPTION

Chapter Twelve. Common Administrative Tasks. Objectives. Set up, manage, and print to printers on a Linux system Understand the purpose of log files and how they are administered - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter Twelve

Linux+ Guide to Linux Certification

Chapter Twelve

Common Administrative Tasks

Page 2: Chapter Twelve

ObjectivesObjectives

• Set up, manage, and print to printers on a Linux system

• Understand the purpose of log files and how they are administered

• Create, modify, manage, and delete user and group accounts using command-line utilities and the Red Hat User Manager

Page 3: Chapter Twelve

Printer Administration:Printer Administration:The Print ProcessThe Print Process

• A set of information that is sent to a printer at the same time is called a print job– To send a print job to a printer, you must first use the lpr

command and specify what to print

– Next, the line printer daemon (lpd) assigns the print job a unique print job ID and places a copy of the print job into a temporary directory on the filesystem called the print queue, provided the printer is enabled

• If the printer is disabled, then the lpd prints an error message stating the printer is not accepting print jobs

Page 4: Chapter Twelve

Printer Administration:Printer Administration:The Print ProcessThe Print Process

• Accepting print jobs is commonly called spooling

• If the printer is started, the lpd sends the print job from the print queue to the printer– Conversely, if the printer is stopped, the print job

remains in the print queue

• Sending jobs from a print queue to a printer is commonly called printing

Page 5: Chapter Twelve

Printer Administration:Printer Administration:The Print ProcessThe Print Process

Figure 12-1: The print process

Page 6: Chapter Twelve

Printer Administration:Printer Administration:The Print ProcessThe Print Process

• lpc command– Used to view the status of and control printers on the system

Table 12-1: Common keywords used in the lpc command

Page 7: Chapter Twelve

Printer Administration:Printer Administration:Managing Print JobsManaging Print Jobs

Table 12-2: Common options to the lpr command

Page 8: Chapter Twelve

Printer Administration:Printer Administration:Managing Print JobsManaging Print Jobs

• Postscript– Non-text file format that is commonly used in

documents

• enscript command– Command used to print Postscript formatted files

• a2ps command– Other command also used to print Postscript

formatted files

Page 9: Chapter Twelve

Printer Administration:Printer Administration:Managing Print JobsManaging Print Jobs

• lpq command– Command used to view the contents of print

queries

• lprm command– Command used to remove print jobs from the

print queue

Page 10: Chapter Twelve

Printer Administration:Printer Administration:Managing Print JobsManaging Print Jobs

Table 12-3: Common options to the lpq command

Page 11: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

• /etc/printcap– File that holds the configuration information for

each printer installed on the system

• Red Hat Printer Configuration Tool– Graphical utility used to configure printers on the

system

Page 12: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-2: The Red Hat Printer Configuration Tool

Page 13: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-3: Creating a new printer

Page 14: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-4: Specifying the name and type of a printer

Page 15: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-5: Configuring a local printer

Page 16: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-6: Configuring a UNIX printer

Page 17: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

• User account– Information

regarding a user that is stored in a system database

Figure 12-7: Configuring a Windows printer

Page 18: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-8: Configuring a Novell printer

Page 19: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-9: Configuring a JetDirect printer

Page 20: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

12-10: Selecting a printer driver

Page 21: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

12-11: Completing printer creation

Page 22: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-12: Viewing printer in the Red Hat Printer Configuration Tool

Page 23: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-13: Creating a printer alias

Page 24: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-14: Editing the device used for a local printer

Page 25: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-15: Editing the print driver

Page 26: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-16: Editing printer options

Page 27: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-17: Saving changes and restarting lpd

Page 28: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-18: Printing a test page

Page 29: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Figure 12-19: The Red Hat Printer Configuration Tool (terminal interface)

Page 30: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

• Although the Red Hat Printer Configuration Tool is the easiest method for creating printers, you may also add printers by editing the /etc/printcap.local file

• /etc/printcap.local– A file that holds printer configuration information for

each printer installed on the system

Page 31: Chapter Twelve

Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers

Table 12-4: Common keywords used in the /etc/printcap file

Page 32: Chapter Twelve

Log File AdministrationLog File Administration

• Log files– Files containing information about the Linux

system

• /var/log– A directory that contains most log files on a

Linux system

Page 33: Chapter Twelve

Log File AdministrationLog File Administration

Table 12-5: Common Linux log files found in /var/log

Page 34: Chapter Twelve

Log File AdministrationLog File Administration

Table 12-5 (continued): Common Linux log files found in /var/log

Page 35: Chapter Twelve

The System Log DaemonThe System Log Daemon

• System log daemon (syslogd)– Logs system events to various log files via

information stored in /etc/syslog.conf

• Facility– When logging events, refers to the area of the system

from which information is gathered

• Priority– Importance of system information when logging

system events

Page 36: Chapter Twelve

The System Log DaemonThe System Log Daemon

Table 12-6: Facilities used by the system log daemon

Page 37: Chapter Twelve

The System Log DaemonThe System Log Daemon

Table 12-7: Priorities used by the log daemon

Page 38: Chapter Twelve

Managing Log FilesManaging Log Files

• Do not remove log files, as the permissions and ownership will be removed as well

• /etc/logrotate.conf– File used by the logrotate utility to specify

rotation parameters for log files

• logrotate command– Used to rotate log files

Page 39: Chapter Twelve

Administering Users and GroupsAdministering Users and Groups

• Authentication– Act of verifying a user’s identity by comparing a

username and password to a system database

• The system database that contains user account information typically consists of two files:– /etc/passwd– /etc/shadow

Page 40: Chapter Twelve

Administering Users and GroupsAdministering Users and Groups

• To convert the system so it will use an /etc/shadow file to store the encrypted password after installation, you may run the pwconv command– Alternatively, the pwunconv command may be used to

revert back to using an /etc/passwd file only

• User Identifier (UID)– Specifies the unique user ID assigned to each user

• Group Identifier (GID)– Primary group ID for each user

Page 41: Chapter Twelve

Administering Users and GroupsAdministering Users and Groups

• Primary group– Specified for a user in the /etc/passwd file– Specified as group owner for all files created by a

user

• General Electric Comprehensive Operating System (GECOS)– The field in the /etc/passwd file that contains a

description of the user account

Page 42: Chapter Twelve

Creating User AccountsCreating User Accounts

• useradd command– Used to add a user account to the system

• /etc/login.defs– File that contains default values for user creation

Page 43: Chapter Twelve

Creating User AccountsCreating User Accounts

• /etc/default useradd– File that contains default values for user creation

• Skeleton directory– Directory that contains files that are copied to all

new users’ home directories upon creation

Page 44: Chapter Twelve

Creating User AccountsCreating User Accounts

Table 12-8: Common options to the useradd command

Page 45: Chapter Twelve

Modifying User AccountsModifying User Accounts

Table 12-9: Common options to the usermod command

Page 46: Chapter Twelve

Modifying User AccountsModifying User Accounts

• chage command– Used to modify password expiry information for user

accounts

• Locking an account– Making an account temporarily unusable by altering

the password information for it stored on the system

• chsh command– Used to change a valid shell to an invalid shell

Page 47: Chapter Twelve

Deleting User AccountsDeleting User Accounts

• userdel command– Used to remove a user account from the system

• When a user account is deleted, any files that were previously owned by the user become owned by a number that represents the UID of the deleted user

Page 48: Chapter Twelve

Managing GroupsManaging Groups

• groupadd command– Used to add a group to the system

• groupmod command– Used to modify the name of GID of a group on

the system

• groupdel command– Used to add a group to the system

Page 49: Chapter Twelve

Using the Red Hat User ManagerUsing the Red Hat User Manager

Figure 12-20: The Red Hat User Manager

Page 50: Chapter Twelve

Using the Red Hat User ManagerUsing the Red Hat User Manager

Figure 12-21: Viewing groups in the Red Hat User Manager

Page 51: Chapter Twelve

Using the Red Hat User ManagerUsing the Red Hat User Manager

Figure 12-22: Creating a new user account

Page 52: Chapter Twelve

Using the Red Hat User ManagerUsing the Red Hat User Manager

Figure 12-23: Creating a new group account

Page 53: Chapter Twelve

Using the Red Hat User ManagerUsing the Red Hat User Manager

Figure 12-24: Editing the properties of a user account

Page 54: Chapter Twelve

Using the Red Hat User ManagerUsing the Red Hat User Manager

Figure 12-25: Editing the disable date and lockout of a user account

Page 55: Chapter Twelve

Using the Red Hat User ManagerUsing the Red Hat User Manager

Figure 12-26: Editing the password expiration parameters for a user account

Page 56: Chapter Twelve

Using the Red Hat User ManagerUsing the Red Hat User Manager

Figure 12-27: Editing the group membership of a user account

Page 57: Chapter Twelve

Using the Red Hat User ManagerUsing the Red Hat User Manager

Figure 12-28: Editing a group name

Page 58: Chapter Twelve

Using the Red Hat User ManagerUsing the Red Hat User Manager

Figure 12-29: Editing the members of a group

Page 59: Chapter Twelve

Chapter SummaryChapter Summary

• Print jobs are spooled to a print queue before being printed to a printer

• You may disable spooling or printing for a printer by using the lpc command

• Print jobs are created by the lpr command, may be viewed in the print queue using the lpq command, and may be removed from the print queue using the lprm command

Page 60: Chapter Twelve

Chapter SummaryChapter Summary

• You may create local and remote printers using the Red Hat Printer Configuration tool or by modifying the /etc/printcap.local file

• Most log files on a Linux system are stored in the /var/log directory

• System events are typically logged to files by the system log daemon

• Log files should be cleared or rotated over time to save disk space

Page 61: Chapter Twelve

Chapter SummaryChapter Summary

• User and group account information is typically stored in the /etc/passwd, etc/shadow, and /etc/group files

• You may use the useradd command to create users and the groupadd command to create group

• All users must have a valid password before logging into a Linux system

Page 62: Chapter Twelve

Chapter SummaryChapter Summary

• Users may be modified with the usermod, chage, chsh, and passwd commands, and groups may be modified using the groupmod command

• The userdel and groupdel commands may be used to remove users and groups from the system, respectively

• The Red Hat User Manager is a graphical utility that can manage users and groups on the system from a desktop environment