Download - Chapter Twelve
Linux+ Guide to Linux Certification
Chapter Twelve
Common Administrative Tasks
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
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
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
Printer Administration:Printer Administration:The Print ProcessThe Print Process
Figure 12-1: The print process
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
Printer Administration:Printer Administration:Managing Print JobsManaging Print Jobs
Table 12-2: Common options to the lpr command
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
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
Printer Administration:Printer Administration:Managing Print JobsManaging Print Jobs
Table 12-3: Common options to the lpq command
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
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-2: The Red Hat Printer Configuration Tool
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-3: Creating a new printer
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-4: Specifying the name and type of a printer
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-5: Configuring a local printer
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-6: Configuring a UNIX printer
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
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-8: Configuring a Novell printer
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-9: Configuring a JetDirect printer
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
12-10: Selecting a printer driver
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
12-11: Completing printer creation
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-12: Viewing printer in the Red Hat Printer Configuration Tool
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-13: Creating a printer alias
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-14: Editing the device used for a local printer
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-15: Editing the print driver
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-16: Editing printer options
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-17: Saving changes and restarting lpd
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-18: Printing a test page
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Figure 12-19: The Red Hat Printer Configuration Tool (terminal interface)
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
Printer Administration:Printer Administration:Configuring PrintersConfiguring Printers
Table 12-4: Common keywords used in the /etc/printcap file
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
Log File AdministrationLog File Administration
Table 12-5: Common Linux log files found in /var/log
Log File AdministrationLog File Administration
Table 12-5 (continued): Common Linux log files found in /var/log
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
The System Log DaemonThe System Log Daemon
Table 12-6: Facilities used by the system log daemon
The System Log DaemonThe System Log Daemon
Table 12-7: Priorities used by the log daemon
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
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
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
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
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
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
Creating User AccountsCreating User Accounts
Table 12-8: Common options to the useradd command
Modifying User AccountsModifying User Accounts
Table 12-9: Common options to the usermod command
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
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
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
Using the Red Hat User ManagerUsing the Red Hat User Manager
Figure 12-20: The Red Hat User Manager
Using the Red Hat User ManagerUsing the Red Hat User Manager
Figure 12-21: Viewing groups in the Red Hat User Manager
Using the Red Hat User ManagerUsing the Red Hat User Manager
Figure 12-22: Creating a new user account
Using the Red Hat User ManagerUsing the Red Hat User Manager
Figure 12-23: Creating a new group account
Using the Red Hat User ManagerUsing the Red Hat User Manager
Figure 12-24: Editing the properties of a user account
Using the Red Hat User ManagerUsing the Red Hat User Manager
Figure 12-25: Editing the disable date and lockout of a user account
Using the Red Hat User ManagerUsing the Red Hat User Manager
Figure 12-26: Editing the password expiration parameters for a user account
Using the Red Hat User ManagerUsing the Red Hat User Manager
Figure 12-27: Editing the group membership of a user account
Using the Red Hat User ManagerUsing the Red Hat User Manager
Figure 12-28: Editing a group name
Using the Red Hat User ManagerUsing the Red Hat User Manager
Figure 12-29: Editing the members of a group
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
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
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
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