Oracle Linux System Administration
Total Page:16
File Type:pdf, Size:1020Kb
Oracle Linux System Administration Student Guide – Volume II D74508GC10 Edition 1.0 August 2012 D78745 Author Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Craig McBride Disclaimer This document contains proprietary information and is protected by copyright and Technical Contributors and Reviewers other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in Avi Miller any way. Except where your use constitutes "fair use" under copyright law, you may Elena Zannoni not use, share, download, upload, copy, print, display, perform, reproduce, publish, Lenz Grimmer license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. Sergio Leunissen Waseem Daher The information contained in this document is subject to change without notice. If you Wim Coekaerts find any problems in the document, please report them in writing to: Oracle University, Al Flournoy 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free. Harald Van Breederode Joel Goodman Restricted Rights Notice Manish Kapur If this documentation is delivered to the United States Government or anyone using Soeren Binner the documentation on behalf of the United States Government, the following notice is Jeremy Smyth applicable: Yasar Akthar U.S. GOVERNMENT RIGHTS Javier Saiz The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or Ozgur Yuksel disclose these training materials are restricted by the terms of the applicable Oracle Antoinette O’Sullivan license agreement and/or the applicable U.S. Government contract. Frank Allan Trademark Notice Gavin Bowe Gino Kawalski Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Jeff Suchomel Rob Swank Ron Hardin Michele Dady Matt Taylor Graphic Designer Maheshwari Krishnamurthy Editors Richard Wallis Raj Kumar Daniel Milne Smita Kommini Publishers Giri Venugopal Michael Sebastian Almeida Contents 1 Course Introduction Course Objectives 1-2 Course Schedule 1-3 Lesson Objectives 1-6 Virtualization with Oracle VM Server 1-7 Oracle VM Server in the Classroom 1-8 Summary 1-10 Practices Overview 1-11 2 Introduction to Oracle Linux Objectives 2-2 Linux Kernel 2-3 The GNU Project 2-5 GNU General Public License (GPL) 2-6 Linux Kernel Development Model 2-8 Mainline Kernel Development Continues 2-10 Linux Distributions 2-11 Oracle Linux 2-13 Oracle’s Technical Contributions to Linux 2-14 Oracle Linux: Compatible with Red Hat Enterprise Linux (RHEL) 2-16 Unbreakable Enterprise Kernel 2-18 Unbreakable Enterprise Kernel Release 1 2-19 Unbreakable Enterprise Kernel Release 2 2-22 Tracking Mainline 2-25 DTrace 2-26 Btrfs Filesystem 2-27 Oracle Linux Release Notes 2-28 Summary 2-29 Quiz 2-30 Practice 2: Overview 2-32 3 Installing Oracle Linux Objectives 3-2 Obtaining Oracle Linux 3-3 Oracle Software Delivery Cloud 3-4 iii The Anaconda Installer 3-5 The Boot Menu 3-6 Boot Options 3-7 Media Test 3-8 Language Selection 3-9 Keyboard Selection 3-10 Storage Devices Selection 3-11 Setting the Host Name 3-12 Configuring Network 3-13 IPv4 Settings 3-14 Time Zone Selection 3-15 Setting Root Password 3-16 Disk Partitioning Setup 3-17 Storage Devices 3-18 Default Partition Layout 3-19 Create Custom Layout 3-20 Standard Partition 3-21 Confirming Partitions 3-23 Boot Loader Selection 3-24 Quiz 3-25 Software Package Selection 3-26 Customize the Package Selection 3-28 Software Installation 3-29 FirstBoot Tool 3-30 Unattended Installation with Kickstart 3-31 Quiz 3-33 Summary 3-34 Practice 3: Overview 3-35 4 Linux Boot Process Objectives 4-2 Linux Boot Process 4-3 Master Boot Record (MBR) 4-4 GRUB Bootloader 4-5 GRUB Configuration File 4-7 GRUB Menu 4-10 Editing a GRUB Menu Option 4-11 Kernel Boot Parameters 4-12 GRUB Command Line 4-14 The /sbin/init Process 4-15 SysV init Runlevels 4-16 iv Working with Runlevels 4-17 The /etc/inittab File 4-19 The /etc/rc.d Directory 4-22 Stopping and Starting Services 4-24 Configuring Services 4-25 The ntsysv Utility 4-27 Summary 4-28 Quiz 4-29 Practice 4: Overview 4-32 5 System Configuration Objectives 5-2 The /etc/sysconfig Directory 5-3 The /proc File System 5-5 Top-Level Files Within /proc 5-7 Process Directories in /proc 5-9 Other Directories in /proc 5-10 sysfs File System 5-12 sysctl Utility 5-14 Quiz 5-16 Summary 5-19 Practice 5: Overview 5-20 6 Package Management Objectives 6-2 Introduction to Package Management 6-3 The rpm Utility 6-4 Oracle Public yum Server 6-6 yum Configuration 6-8 The yum Utility 6-10 yum Groups 6-12 Unbreakable Linux Network (ULN) 6-13 ULN Channels 6-14 Kernel RPM Packages 6-16 Switching from RHN to ULN 6-17 Quiz 6-19 Summary 6-21 Practice 6: Overview 6-22 v 7 Ksplice Objectives 7-2 Introduction to Ksplice 7-3 How Ksplice Works 7-4 Ksplice Implementation 7-5 Generating an Access Key Through ULN 7-6 Creating Your Oracle Ksplice Uptrack Account 7-7 Setting Up Your Server with the Uptrack Tools 7-8 Installation Instructions 7-10 Manual Installation Instructions for Oracle Linux 7-11 Using Ksplice Uptrack 7-12 Ksplice Uptrack Command Summary 7-13 System Status 7-14 System Updated 7-15 Quiz 7-16 Summary 7-17 8 Automating Tasks Objectives 8-2 Automating System Tasks 8-3 Configuring cron Jobs 8-4 Other cron Directories and Files 8-6 crontab Utility 8-8 Configuring anacron Jobs 8-9 at and batch 8-11 Quiz 8-13 Summary 8-14 Practice 8: Overview 8-15 9 System Logging Objectives 9-2 System Log File Configuration 9-3 Facility/Priority-Based Filters 9-5 rsyslog Actions 9-7 rsyslog Templates 9-9 Configuring Log Rotation (logrotate) 9-11 logwatch 9-13 Quiz 9-14 Summary 9-15 Practice 9: Overview 9-16 vi 10 Kernel Module Configuration Objectives 10-2 Loadable Kernel Modules (LKM) 10-3 Loading and Unloading Kernel Modules 10-5 Kernel Module Parameters 10-8 Quiz 10-10 Summary 10-11 Practice 10: Overview 10-12 11 User and Group Administration Objectives 11-2 Introduction to Users and Groups 11-3 User and Group Configuration Files 11-4 Adding a User Account 11-6 Modifying or Deleting User Accounts 11-9 Group Account Administration 11-10 User Private Groups 11-12 Password Configuration 11-14 The /etc/login.defs File 11-16 User Manager Tool 11-17 User/Group Administration in the Enterprise 11-18 Quiz 11-19 Summary 11-21 Practice 11: Overview 11-22 12 Oracle Linux File Systems Objectives 12-2 Disk Partitions 12-3 Partition Table Manipulation Utilities 12-5 The fdisk Utility 12-6 Using the fdisk Utility 12-8 cfdisk Utility 12-11 parted Utility 12-12 File System Types 12-14 Making File Systems 12-16 Mounting File Systems 12-18 /etc/fstab File 12-21 Maintaining File Systems 12-22 Access Control Lists (ACLs) 12-24 Quiz 12-26 Swap Space 12-27 vii Disk Quotas 12-29 Configuring Disk Quotas 12-30 Quiz 12-33 Summary 12-34 Practice 12: Overview 12-35 13 Storage Administration Objectives 13-2 Logical Volume Manager (LVM) 13-3 LVM Configuration: Example 13-4 Physical Volume Utilities 13-5 Volume Group Utilities 13-7 Logical Volume Utilities 13-9 Making Logical Volumes Usable 13-11 Redundant Array of Independent Disks (RAID) 13-13 mdadm Utility 13-15 Making RAID Devices Usable 13-17 Encrypted Block Devices 13-18 cryptsetup Utility 13-19 Making an Encrypted Device Usable 13-21 The kpartx Utility 13-22 Quiz 13-24 Summary 13-25 Practice 13: Overview 13-26 14 Network Configuration Objectives 14-2 Network Interfaces 14-3 Additional Network Configuration Files 14-5 Command-Line Network Interface Utilities 14-7 Network Interface Bonding 14-9 VLANs 14-11 route Utility 14-13 NetworkManager 14-15 Network Connections Window 14-18 system-config-network Utility 14-19 Device Configuration 14-20 DNS Client Configuration 14-21 Quiz 14-22 Summary 14-23 Practice 14: Overview 14-24 viii 15 Network Addressing and Name Services Objectives 15-2 Introduction to DHCP 15-3 Configuring a DHCP Server 15-4 Configuring a DHCP Client 15-7 Introduction to DNS 15-9 Nameserver Types 15-10 BIND 15-11 DNS Cache-Only Nameserver 15-12 Starting a DNS Cache-Only Nameserver 15-15 Zone Files 15-16 Reverse Name Resolution 15-18 rndc Utility 15-20 host and dig Utilities 15-22 Quiz 15-23 Summary 15-24 Practice 15: Overview 15-25 16 File Sharing Objectives 16-2 Introduction to NFS 16-3 NFS Server Configuration 16-6 Starting the NFS Service 16-8 The exportfs Utility 16-9 NFS Client Configuration 16-10 Auto-Mounting File Systems 16-12 Introduction to Samba 16-15 Samba Daemons and Services 16-16 Samba Server Configuration 16-17 Samba Server Types 16-19 Access Linux Shares from Windows 16-22 Access Windows Shares from Linux 16-24 Samba Utilities 16-25 Introduction to vsftpd 16-27 vsftpd Configuration Options 16-28 Quiz 16-30 Summary 16-31 Practice 16: Overview 16-32 ix 17 OpenSSH Objectives 17-2 Introduction to OpenSSH 17-3 OpenSSH Configuration Files 17-4 OpenSSH Configuration 17-6 Using OpenSSH Utilities 17-7 Using the ssh Command 17-9 Using the scp Command 17-10 Using the sftp Command 17-11 Using the ssh-keygen Command 17-12 Quiz 17-14 Summary 17-15 Practice 17: Overview 17-16 18 Authentication and Directory Services Objectives 18-2 Authentication Options 18-3 Authentication Configuration Tool 18-4 NIS Authentication 18-5 NIS Maps 18-6 NIS Server Configuration 18-8 NIS Client Configuration 18-10 Implementing NIS Authentication 18-11 Lightweight Directory Access Protocol (LDAP) 18-13 OpenLDAP 18-15 OpenLDAP Server Utilities 18-17 OpenLDAP