Linux+ Guide to Linux Certification, Third Edition Chapter 10 Common Administrative Tasks.

  • Published on
    01-Jan-2016

  • View
    212

  • Download
    0

Embed Size (px)

Transcript

<ul><li><p>Linux+ Guide to Linux Certification, Third EditionChapter 10Common Administrative Tasks</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*ObjectivesSet up, manage, and print to printers on a Linux systemUnderstand the purpose of log files and how they are administeredCreate, modify, manage, and delete user and group accounts</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Printer Administration: The Common UNIX Printing SystemCommon Unix Printing System (CUPS): most common printing system used on LinuxPrint job: set of information sent to a printer at the same timeCan consist of a file, a set of files, or the output of a commandlp command: sends a print job to a printer</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Printer Administration: The Common UNIX Printing System (continued)cups daemon (cupsd): responsible for printing in CUPS printing systemPrint job ID: print jobs unique identifier Assigned by cupsdPrint queue: directory holding print jobs waiting to be printedTypically /var/spool/cups</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Printer Administration: The Common UNIX Printing System (continued)Printer can accept or reject request to printIf rejected, CUPS gives an error messageSpooling or queuing: accepting print jobs into a print queuePrinting: sending print jobs from print queue to a printerOccurs if the printer is enabled, cupsd removes copy of print job from the print queue. </p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Printer Administration: The Common UNIX Printing System (continued)Figure 10-1: The print process</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Printer Administration: The Common UNIX Printing System (continued)lpstat command: with t (total) option, lists all printers and their statuscupsaccept, cupsreject, cupsenable, and cupsdisable commands: manipulate status of a printer-r option: used to specify reason for cupsdisable and cupsreject commands</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Managing Print Jobslp d command: print to a specified printerIf d option omitted, prints to default printerlpoptions d command: set default printerEach user can set his own default printer Add name of the default printer to .lpoptions file in home directoryUse PRINTER or LPDEST variable</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Managing Print Jobs (continued)lp command accepts information from stdinlpstat command can list print jobs in queue for a printercancel command: remove print jobs from print queueReceives print job IDs as arguments-u option: remove all the jobs sent by specified userlpadmin command: perform printer administratione.g., restrict specific user access to specific printers</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Managing Print Jobs (continued)Table 10-1: Common options to the lp command</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Managing Print Jobs (continued)Table 10-2: Common options to the lpstat command</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*The LPD Printing SystemLine Printer Daemon (LPD): printing system used on older Linux systemslpr command: send documents to a print queuelpc command: view status of printerslpq command: view print jobs in print queuelprm command: remove print jobsCUPS contains versions of the lpr, lpc, lpq, and lprm commands</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers/etc/cups/cupsd.conf: contains cupsd settings /etc/cups/printers.conf: contains each printers configuration informationPrinter Configuration tool: used to edit printer and cupsd setting files and thus configure printersActivated using the system-config-printer command in a desktop environmente.g., add new printers</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers (continued)Figure 10-2: The Printer Configuration tool</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers (continued)Figure 10-3: Specifying the printer device</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers (continued)For local printers that do not support PnP, must specify the Uniform Resource Identifier (URI) for the deviceWithin Printer Configuration tool you can:Give a printer a name to identify it within programs and commandsSpecify printer location and descriptionModify printer propertiesManage the status of the printer, share it using IPP, choose an error action, and configure banner pages</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers (continued)Figure 10-4: Selecting the printer manufacturer</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers (continued)Figure 10-5: Selecting the printer model</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers (continued)Figure 10-6: Completing the creation of a new printer</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers (continued)Figure 10-7: Viewing installed printers</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers (continued)Figure 10-8: Modifying printer properties</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers (continued)Figure 10-9: The Policies section of printer properties</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers (continued)Figure 10-10: The Access control section of printer properties</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Configuring Printers (continued)To apply standard printer properties to several printers on a system, create printer classApply the properties to the printer classPrinter Configuration tool allows configuration of the properties of CUPS daemonAdd shared network printersShare printers on the systemRemotely create and manage printersLinux+ Guide to Linux Certification, 3e*</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Configuring Printers (continued)Figure 10-11: Configuring CUPS settings</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Log File AdministrationLog file: file containing system informationTypically recorded during daemon activityInformation includes error messages/var/log: contains most log filesMany programs store log files in subdirectories</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Log File Administration (continued)Table 10-3: Common Linux log files found in /var/log</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*The System Log DaemonSystem log daemon (syslogd): central handling of logging system eventsCreates /dev/log socket for system processes to write toWrites to appropriate log file using /etc/rsyslog.conf fileEntries indicate facility and priorityFacility: area of system that information is gathered fromPriority: importance of system information</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*The System Log Daemon (continued)Table 10-4: Facilities used by the System Log Daemon</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*The System Log Daemon (continued)Table 10-5: Priorities used by the log daemon</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Managing Log FilesLog files can take up unnecessary spaceClear contents occasionallyPrint copy for recordsUse &gt; redirection symbol to clear log fileUse cron daemon for repetitive clearingDo not remove log files Permissions and ownership will be removed</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Managing Log Files (continued)logrotate command: back up and clear log filesCompress old log files and save under new name/etc/logrotate.conf: used by logrotate utility Specifies rotation parameters for log files</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Administering Users and GroupsAuthentication: verify users identityCompare username and password to system databaseDatabase containing user account information typically consists of two files/etc/passwd: user account information/etc/shadow: encrypted password and expiration informationpwconv command: convert system to use an /etc/shadow file for encrypted password storageLinux+ Guide to Linux Certification, 3e*</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Administering Users and Groups (continued)pwunconv command: revert back to using an /etc/passwd file onlyUser Identifier (UID): unique user ID for each userGroup Identifier (GID): primary group ID for each userPrimary group: group owner for all files created by a userGeneral Electric Comprehensive Operating System (GECOS): text description of the userTypically left blankLinux+ Guide to Linux Certification, 3e*</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Administering Users and Groups (continued)Root user usually listed at top of /etc/passwd fileNext are listed system daemonsPassword field differs in the two files:/etc/shadow: contains encrypted password/etc/passwd: contains an x characterlastchange: date of most recent password changeNumber represents number of days since January 1, 1970</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Administering Users and Groups (continued)Passwords often set to expire at certain intervalsIntervals specified in /etc/shadowMinimum number of days before changing passwordMaximum number of days to use passwordNumber of days before password expiration in which user is warned to change password/etc/group file: Lists all groups and their membersAllows users to belong to multiple groupsPassword field usually contains an x</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Creating User Accountsuseradd command: add new user accountsMost new user information comes from two files/etc/login.defsE-mail location, password expiration, minimum password length, range of UIDs and GIDs/etc/default/useraddDefault primary group, home directory location, password expiration info, shell, skeleton directory</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Creating User Accounts (continued)Skeleton directory: contains environment files to copy to new users home directoriesUsually /etc/skelOverride default parameters by specifying options to useradd commandpasswd command: set a users passwordIf no arguments, sets current users passwordUser accounts must have password set to log onRoot user can change any users password</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Creating User Accounts (continued)Table 10-6: Common options to the useradd command</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Modifying User Accountsusermod command: modify user account information chage command: modify password expiration informationLocking an account: make an account temporarily unusableAlter password informationUse l or L options of passwd commandchsh command: change a valid shell to an invalid shell</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Modifying User Accounts (continued)Table 10-7: Common options to the usermod command</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Deleting User Accountsuserdel command: remove user accountsSpecify user name as argumentWhen an account is deleted, files previously owned by the user become owned by a number representing UID of deleted userNext user with that UID will own the files</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Managing GroupsCan add groups by editing /etc/group filegroupadd command: add a group to the systemgroupmod command: modify GID name of a group on the systemgroupdel command: remove a group from the system</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Managing Groups (continued)groups command: list groups that user belongs toid command: list GIDs of groups that a user belongs tonewgrp command: temporarily change users primary groupGraphical utilities exist to create, modify, and delete user and group accounts</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Managing Groups (continued)Figure 10-13: Configuring users and groups within a desktop environment</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*SummaryPrint jobs are spooled to a print queue before being printed to a printerYou can configure spooling or printing by using the cupsaccept, cupsreject, cupsenable, and cupsdisable commandsPrint jobs are created using lp, can be viewed in the queue using lpstat, and are removed from the queue using cancel</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Summary (continued)Create local and remote printers using Printer Configuration tool or by modifying /etc/cups/printers.confMost log files in Linux are stored in /var/logSystem events are typically logged to files by the System Log DaemonLog files should be cleared or rotated over time to save disk spaceUser and group account information is typically in /etc/passwd, /etc/shadow, and /etc/groupLinux+ Guide to Linux Certification, 3e*</p><p>Linux+ Guide to Linux Certification, 3e</p></li><li><p>Linux+ Guide to Linux Certification, 3e*Summary (continued)Use the useradd command to create users and the groupadd command to create groupsAll users must have a valid password before logging in to a Linux systemUsers can be modified with usermod, chage, chfn, chsh, and passwd commands, and groups can be modified using groupmod commandThe userdel and groupdel commands remove users and groups from the system, respectively</p><p>Linux+ Guide to Linux Certification, 3e</p></li></ul>

Recommended

View more >