Fedora 16 System Administrator's Guide Deployment, Configuration, and Administration of Fedora 16 Jaromír Hradílek Douglas Silas Martin Prpič Eva Kopalová Eliška Slobodová Tomáš Čapek Petr Kovář Miroslav Svoboda System Administrator's Guide John Ha David O'Brien Michael Hideo Don Domingo Fedora 16 System Administrator's Guide Deployment, Configuration, and Administration of Fedora 16 Edition 1 Author Jaromír Hradílek [email protected] Author Douglas Silas [email protected] Author Martin Prpič [email protected] Author Eva Kopalová [email protected] Author Eliška Slobodová [email protected] Author Tomáš Čapek [email protected] Author Petr Kovář [email protected] Author Miroslav Svoboda [email protected] Author John Ha Author David O'Brien Author Michael Hideo Author Don Domingo Copyright © 2011 Red Hat, Inc. and others. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. The original authors of this document, and Red Hat, designate the Fedora Project as the "Attribution Party" for purposes of CC-BY-SA. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. For guidelines on the permitted uses of the Fedora trademarks, refer to https://fedoraproject.org/wiki/ Legal:Trademark_guidelines. Linux® is the registered trademark of Linus Torvalds in the United States and other countries. Java® is a registered trademark of Oracle and/or its affiliates. XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries. MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries. All other trademarks are the property of their respective owners. The System Administrator's Guide documents relevant information regarding the deployment, configuration, and administration of Fedora 16. It is oriented towards system administrators with a basic understanding of the system. Preface xv 1. Target Audience ............................................................................................................ xv 2. How to Read this Book .................................................................................................. xv 3. Document Conventions ................................................................................................ xviii 3.1. Typographic Conventions .................................................................................. xviii 3.2. Pull-quote Conventions ....................................................................................... xix 3.3. Notes and Warnings ........................................................................................... xx 4. Feedback ...................................................................................................................... xx 5. Acknowledgments ......................................................................................................... xxi I. Basic System Configuration 1 1. Configuring the Language and Keyboard 3 1.1. Changing the Language ....................................................................................... 3 1.2. Changing the Date, Time, and Numeric Format ...................................................... 4 1.3. Changing the Keyboard Layout ............................................................................. 6 1.4. Viewing the Current Configuration ......................................................................... 8 2. Configuring the Date and Time 9 2.1. Using the Date and Time Configuration Tool .......................................................... 9 2.2. Using the Command Line Tools .......................................................................... 10 2.2.1. Changing the Date ................................................................................... 10 2.2.2. Changing the Time .................................................................................. 10 2.2.3. Configuring the Network Time Protocol ..................................................... 10 2.3. Additional Resources .......................................................................................... 12 2.3.1. Installed Documentation ........................................................................... 12 3. Managing Users and Groups 13 3.1. Introduction to Users and Groups ........................................................................ 13 3.1.1. User Private Groups ................................................................................ 13 3.1.2. Shadow Passwords ................................................................................. 13 3.2. Using the User Accounts Tool ............................................................................. 14 3.2.1. Configuring an Account ............................................................................ 15 3.2.2. Adding a New User ................................................................................. 16 3.2.3. Removing a User ..................................................................................... 16 3.3. Using the User Manager Tool ............................................................................. 17 3.3.1. Viewing Users and Groups ....................................................................... 17 3.3.2. Adding a New User ................................................................................. 18 3.3.3. Adding a New Group ............................................................................... 19 3.3.4. Modifying User Properties ........................................................................ 19 3.3.5. Modifying Group Properties ...................................................................... 20 3.4. Using Command Line Tools ................................................................................ 21 3.4.1. Adding a New User ................................................................................. 21 3.4.2. Adding a New Group ............................................................................... 24 3.4.3. Enabling Password Aging ......................................................................... 25 3.4.4. Enabling Automatic Logouts ..................................................................... 26 3.4.5. Creating Group Directories ....................................................................... 27 3.5. Additional Resources .......................................................................................... 28 3.5.1. Installed Documentation ........................................................................... 28 II. Package Management 29 4. Yum 31 4.1. Checking For and Updating Packages ................................................................. 31 4.1.1. Checking For Updates ............................................................................. 31 v System Administrator's Guide 4.1.2. Updating Packages .................................................................................. 32 4.1.3. Preserving Configuration File Changes ..................................................... 34 4.2. Packages and Package Groups .......................................................................... 34 4.2.1. Searching Packages ................................................................................ 34 4.2.2. Listing Packages ..................................................................................... 34 4.2.3. Displaying Package Information ................................................................ 37 4.2.4. Installing Packages .................................................................................. 38 4.2.5. Removing Packages ................................................................................ 40 4.2.6. Working with Transaction History .............................................................. 41 4.3. Configuring Yum and Yum Repositories ............................................................... 46 4.3.1. Setting [main] Options .............................................................................. 46 4.3.2. Setting [repository] Options ...................................................................... 49 4.3.3. Using Yum Variables ............................................................................... 50 4.3.4. Viewing the Current Configuration ............................................................. 51 4.3.5. Adding, Enabling, and Disabling a Yum Repository .................................... 52 4.3.6. Creating a Yum Repository ...................................................................... 53 4.4. Yum Plug-ins ..................................................................................................... 54 4.4.1. Enabling, Configuring, and Disabling Yum Plug-ins .................................... 54 4.4.2. Installing Additional Yum Plug-ins ............................................................. 55 4.4.3. Plug-in Descriptions ................................................................................. 55 4.5. Additional Resources .......................................................................................... 59 5. PackageKit 61 5.1. Updating Packages with Software Update ............................................................ 61 5.1.1. Setting the Update-Checking Interval ........................................................ 62 5.1.2. Setting the Software Sources ................................................................... 62 5.2. Using Add/Remove Software .............................................................................. 63 5.2.1. Refreshing Software Sources (Yum Repositories) ...................................... 64 5.2.2. Finding Packages with Filters ................................................................... 64 5.2.3. Installing and Removing Packages (and Dependencies) ............................. 66 5.2.4. Installing and Removing Package Groups ................................................. 68 5.2.5. Viewing the Transaction Log .................................................................... 69 5.3. PackageKit Architecture ...................................................................................... 70 5.4. Additional Resources .......................................................................................... 71 III. Networking 73 6. Network Interfaces 75 6.1. Network Configuration Files ................................................................................ 75 6.2. Interface Configuration Files ................................................................................ 76 6.2.1. Ethernet Interfaces .................................................................................. 76 6.2.2. Channel Bonding Interfaces ..................................................................... 79 6.2.3. Alias and Clone Files ............................................................................... 80 6.2.4. Dialup Interfaces ...................................................................................... 81 6.2.5. Other Interfaces ....................................................................................... 83 6.3. Interface Control Scripts ..................................................................................... 83 6.4. Configuring Static Routes ................................................................................... 85 6.5. Network Function Files ....................................................................................... 87 6.6. Additional Resources .......................................................................................... 87 6.6.1. Installed Documentation ........................................................................... 87 IV. Infrastructure Services 89 7. Services and Daemons 91 vi 7.1. Configuring Services ........................................................................................... 91 7.1.1. Enabling the Service ................................................................................ 91 7.1.2. Disabling the Service ............................................................................... 92 7.2. Running Services ............................................................................................... 92 7.2.1. Checking the Service Status .................................................................... 92 7.2.2. Running the Service ................................................................................ 94 7.2.3. Stopping the Service ................................................................................ 94 7.2.4. Restarting the Service .............................................................................. 94 7.3. Additional Resources .......................................................................................... 95 7.3.1. Installed Documentation ........................................................................... 95 7.3.2. Related Books ......................................................................................... 95 8. Configuring Authentication 97 8.1. The Authentication Configuration Tool ................................................................. 97 8.1.1. Identity & Authentication ........................................................................... 97 8.1.2. Advanced Options .................................................................................. 101 8.1.3. Command Line Version .......................................................................... 103 8.2. The System Security Services Daemon (SSSD) ................................................. 107 8.2.1. What is SSSD? ..................................................................................... 107 8.2.2. SSSD Features ...................................................................................... 107 8.2.3. Setting Up SSSD ................................................................................... 109 8.2.4. Configuring Services .............................................................................. 116 8.2.5. Configuring Domains .............................................................................. 118 8.2.6. Setting Up Kerberos Authentication ......................................................... 126 8.2.7. Configuring a Proxy Domain ................................................................... 129 8.2.8. Troubleshooting ..................................................................................... 131 8.2.9. SSSD Configuration File Format ............................................................. 135 9. OpenSSH 137 9.1. The SSH Protocol ............................................................................................ 137 9.1.1. Why Use SSH? ..................................................................................... 137 9.1.2. Main Features ....................................................................................... 138 9.1.3. Protocol Versions ................................................................................... 138 9.1.4. Event Sequence of an SSH Connection .................................................. 138 9.2. An OpenSSH Configuration ............................................................................... 140 9.2.1. Configuration Files ................................................................................. 140 9.2.2. Starting an OpenSSH Server .................................................................. 142 9.2.3. Requiring SSH for Remote Connections .................................................. 143 9.2.4. Using a Key-Based Authentication .......................................................... 143 9.3. OpenSSH Clients ............................................................................................. 146 9.3.1. Using the ssh Utility ............................................................................... 147 9.3.2. Using the scp Utility .............................................................................. 148 9.3.3. Using the sftp Utility ............................................................................ 148 9.4. More Than a Secure Shell ................................................................................ 149 9.4.1. X11 Forwarding ..................................................................................... 149 9.4.2. Port Forwarding ..................................................................................... 150 9.5. Additional Resources ........................................................................................ 151 9.5.1. Installed Documentation ......................................................................... 151 9.5.2. Useful Websites ..................................................................................... 151 V. Servers 153 10. DHCP Servers 155 10.1. Why Use DHCP? ............................................................................................ 155 10.2. Configuring a DHCP Server ............................................................................ 155 vii System Administrator's Guide 10.2.1. Configuration File ................................................................................. 155 10.2.2. Lease Database ................................................................................... 158 10.2.3. Starting and Stopping the Server .......................................................... 159 10.2.4. DHCP Relay Agent .............................................................................. 160 10.3. Configuring a DHCP Client .............................................................................. 160 10.4. Configuring a Multihomed DHCP Server .......................................................... 161 10.4.1. Host Configuration ............................................................................... 162 10.5. DHCP for IPv6 (DHCPv6) ............................................................................... 164 10.6. Additional Resources ...................................................................................... 164 10.6.1. Installed Documentation ....................................................................... 165 11. DNS Servers 167 11.1. Introduction to DNS ........................................................................................ 167 11.1.1. Nameserver Zones ............................................................................... 167 11.1.2. Nameserver Types ............................................................................... 167 11.1.3. BIND as a Nameserver ........................................................................ 168 11.2. BIND .............................................................................................................. 168 11.2.1. Configuring the named Service ............................................................. 168 11.2.2. Editing Zone Files ................................................................................ 176 11.2.3. Using the rndc Utility ............................................................................ 182 11.2.4. Using the dig Utility .............................................................................. 185 11.2.5. Advanced Features of BIND ................................................................. 187 11.2.6. Common Mistakes to Avoid .................................................................. 188 11.2.7. Additional Resources ............................................................................ 189 12. Web Servers 191 12.1. The Apache HTTP Server ............................................................................... 191 12.1.1. New Features ...................................................................................... 191 12.1.2. Notable Changes ................................................................................. 191 12.1.3. Updating the Configuration ................................................................... 191 12.1.4. Running the httpd Service .................................................................... 192 12.1.5. Editing the Configuration Files .............................................................. 193 12.1.6. Working with Modules .......................................................................... 224 12.1.7. Setting Up Virtual Hosts ....................................................................... 225 12.1.8. Setting Up an SSL Server .................................................................... 225 12.1.9. Additional Resources ............................................................................ 232 13. Mail Servers 233 13.1. Email Protocols .............................................................................................. 233 13.1.1. Mail Transport Protocols ....................................................................... 233 13.1.2. Mail Access Protocols .......................................................................... 234 13.2. Email Program Classifications ......................................................................... 236 13.2.1. Mail Transport Agent ............................................................................ 236 13.2.2. Mail Delivery Agent .............................................................................. 237 13.2.3. Mail User Agent ................................................................................... 237 13.3. Mail Transport Agents ..................................................................................... 237 13.3.1. Postfix ................................................................................................. 237 13.3.2. Sendmail ............................................................................................. 239 13.3.3. Fetchmail ............................................................................................. 244 13.3.4. Mail Transport Agent (MTA) Configuration ............................................. 248 13.4. Mail Delivery Agents ....................................................................................... 249 13.4.1. Procmail Configuration ......................................................................... 249 13.4.2. Procmail Recipes ................................................................................. 250 13.5. Mail User Agents ............................................................................................ 255 13.5.1. Securing Communication ...................................................................... 255 viii 13.6. Additional Resources ...................................................................................... 257 13.6.1. Installed Documentation ....................................................................... 257 13.6.2. Useful Websites ................................................................................... 258 13.6.3. Related Books ..................................................................................... 259 14. Directory Servers 261 14.1. OpenLDAP ..................................................................................................... 261 14.1.1. Introduction to LDAP ............................................................................ 261 14.1.2. Installing the OpenLDAP Suite .............................................................. 263 14.1.3. Configuring an OpenLDAP Server ......................................................... 265 14.1.4. Running an OpenLDAP Server ............................................................. 270 14.1.5. Configuring a System to Authenticate Using OpenLDAP ......................... 271 14.1.6. Additional Resources ............................................................................ 272 15. File and Print Servers 275 15.1. Samba ........................................................................................................... 275 15.1.1. Introduction to Samba .......................................................................... 275 15.1.2. Samba Daemons and Related Services ................................................. 276 15.1.3. Connecting to a Samba Share .............................................................. 277 15.1.4. Configuring a Samba Server ................................................................. 279 15.1.5. Starting and Stopping Samba ............................................................... 280 15.1.6. Samba Server Types and the smb.conf File ........................................ 281 15.1.7. Samba Security Modes ........................................................................ 288 15.1.8. Samba Account Information Databases ................................................. 290 15.1.9. Samba Network Browsing ..................................................................... 291 15.1.10. Samba with CUPS Printing Support ..................................................... 292 15.1.11. Samba Distribution Programs .............................................................. 292 15.1.12. Additional Resources .......................................................................... 297 15.2. FTP ............................................................................................................... 299 15.2.1. The File Transfer Protocol .................................................................... 299 15.2.2. FTP Servers ........................................................................................ 299 15.2.3. Files Installed with vsftpd ................................................................. 300 15.2.4. Starting and Stopping vsftpd ............................................................. 301 15.2.5. vsftpd Configuration Options .............................................................. 302 15.2.6. Additional Resources ............................................................................ 311 15.3. Printer Configuration ....................................................................................... 312 15.3.1. Starting the Printer Configuration Tool ................................................... 312 15.3.2. Starting Printer Setup ........................................................................... 312 15.3.3. Adding a Local Printer .......................................................................... 313 15.3.4. Adding an AppSocket/HP JetDirect printer ............................................. 314 15.3.5. Adding an IPP Printer .......................................................................... 315 15.3.6. Adding an LPD/LPR Host or Printer ...................................................... 316 15.3.7. Adding a Samba (SMB) printer ............................................................. 317 15.3.8. Selecting the Printer Model and Finishing .............................................. 319 15.3.9. Printing a test page .............................................................................. 322 15.3.10. Modifying Existing Printers .................................................................. 323 15.3.11. Additional Resources .......................................................................... 329 VI. Monitoring and Automation 331 16. System Monitoring Tools 333 16.1. Viewing System Processes ............................................................................. 333 16.1.1. Using the ps Command ........................................................................ 333 16.1.2. Using the top Command ....................................................................... 333 16.1.3. Using the System Monitor Tool ............................................................. 334 ix System Administrator's Guide 16.2. Viewing Memory Usage .................................................................................. 336 16.2.1. Using the free Command ...................................................................... 336 16.2.2. Using the System Monitor Tool ............................................................. 336 16.3. Viewing Block Devices and File Systems ......................................................... 337 16.3.1. Using the lsblk Command ..................................................................... 337 16.3.2. Using the blkid Command .................................................................... 338 16.3.3. Using the partx Command .................................................................... 338 16.3.4. Using the findmnt Command ................................................................ 339 16.3.5. Using the df Command ........................................................................ 340 16.3.6. Using the du Command ........................................................................ 340 16.3.7. Using the System Monitor Tool ............................................................. 341 16.4. Viewing Hardware Information ......................................................................... 341 16.4.1. Using the lspci Command ..................................................................... 341 16.4.2. Using the lsusb Command .................................................................... 342 16.4.3. Using the lspcmcia Command .............................................................. 343 16.4.4. Using the lscpu Command .................................................................... 343 16.5. Monitoring Performance with Net-SNMP .......................................................... 343 16.5.1. Installing Net-SNMP ............................................................................. 344 16.5.2. Running the Net-SNMP Daemon ........................................................... 344 16.5.3. Configuring Net-SNMP ......................................................................... 345 16.5.4. Retrieving Performance Data over SNMP .............................................. 348 16.5.5. Extending Net-SNMP ........................................................................... 351 16.6. Additional Resources ...................................................................................... 356 16.6.1. Installed Documentation ....................................................................... 356 17. Viewing and Managing Log Files 357 17.1. Configuring rsyslog ......................................................................................... 357 17.1.1. Global Directives .................................................................................. 357 17.1.2. Modules .............................................................................................. 357 17.1.3. Rules ................................................................................................... 358 17.1.4. rsyslog Command Line Configuration ................................................... 369 17.2. Locating Log Files .......................................................................................... 369 17.2.1. Configuring logrotate ............................................................................ 369 17.3. Viewing Log Files ........................................................................................... 371 17.4. Adding a Log File ........................................................................................... 374 17.5. Monitoring Log Files ....................................................................................... 374 17.6. Additional Resources ...................................................................................... 375 17.6.1. Installed Documentation ....................................................................... 375 17.6.2. Useful Websites ................................................................................... 375 18. Automating System Tasks 377 18.1. Cron and Anacron .......................................................................................... 377 18.1.1. Starting and Stopping the Service ......................................................... 377 18.1.2. Configuring Anacron Jobs ..................................................................... 377 18.1.3. Configuring Cron Jobs .......................................................................... 379 18.1.4. Controlling Access to Cron ................................................................... 381 18.1.5. Black/White Listing of Cron Jobs ........................................................... 381 18.2. At and Batch .................................................................................................. 381 18.2.1. Configuring At Jobs .............................................................................. 382 18.2.2. Configuring Batch Jobs ........................................................................ 382 18.2.3. Viewing Pending Jobs .......................................................................... 383 18.2.4. Additional Command Line Options ........................................................ 383 18.2.5. Controlling Access to At and Batch ....................................................... 383 18.2.6. Starting and Stopping the Service ......................................................... 383 18.3. Additional Resources ...................................................................................... 384 x
Description: