- •About the Author
- •Credits
- •How This Book Is Organized
- •Part I: Linux Basics
- •Part II: Installation
- •Part III: Configuration
- •Part IV: Administration
- •Part V: Maintaining the Linux System
- •How Each Chapter Is Structured
- •How to Use This Book
- •Conventions Used in This Book
- •What is Linux?
- •The origin of UNIX
- •Who started Linux?
- •Understanding Open Source
- •Understanding Closed Source
- •Understanding Artistic License
- •Is Freeware really free?
- •Is Shareware never free?
- •A comparison and contrast of licensing methods
- •The Growth of Linux
- •Linux on a Personal Computer
- •Graphical installation
- •Hardware detection
- •Graphical user interface
- •Linux limitations on the PC
- •Linux succeeds on the PC
- •Linux on workstations
- •Linux on servers
- •Summary
- •Assessment Questions
- •Scenarios
- •Answers to Chapter Questions
- •Assessment Questions
- •Scenarios
- •Linux Kernel
- •Kernel versions
- •Kernel availability
- •Linux Distributions
- •Beehive
- •BlueCat
- •Caldera OpenLinux
- •Debian
- •Corel
- •DragonLinux
- •Elfstone
- •Gentoo
- •Hard Hat Linux
- •KRUD
- •LinuxPPC
- •Mandrake
- •Phat Linux
- •Slackware
- •StormLinux
- •SuSE
- •TurboLinux
- •Yellow Dog Linux
- •Mini and Specialty Distributions
- •Astaro
- •KYZO
- •FlightLinux
- •NetMAX
- •Packages and Packaging Solutions
- •Red Hat Package Manager
- •Debian Package Management System
- •Tarball
- •Linux Resources
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Assessment Questions
- •Scenarios
- •Linux In the Real World
- •Word Processing
- •Spreadsheets and databases
- •Web browsing
- •File transfer
- •More, more, and more applications
- •The Server and DNS
- •A Linux Web server
- •Linux e-mail server
- •File servers
- •Proxy, news, and search servers
- •FTP servers
- •Firewalls
- •Determining Linux Roles and Services
- •Comparing Linux with other operating systems
- •Hardware compatibility
- •Summary
- •Assessment Questions
- •Scenarios
- •Answers to Chapter Questions
- •Assessment Questions
- •Scenarios
- •Installing Linux
- •Final Preparations for Installation
- •Verification
- •Package selection
- •Final hardware verification
- •Pre-installation partitioning planning
- •Installing Linux
- •Text or GUI installation
- •Basic setup of Linux
- •Selecting the machine type
- •Partitioning the hard disk drive
- •Installing a boot manager
- •Creating the Boot Diskette
- •Networking
- •Additional installation information
- •Accounts and passwords
- •Additional packages to install
- •GUI installation
- •Obtaining video card information
- •Configuring the X windows system
- •Selecting the windows manager or desktop environment
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Answers to Assessment Questions
- •Scenarios
- •Alternative to the GUI Installation
- •Command Line installation
- •Install the Linux system
- •Network installations of Linux
- •Review of a Linux Installation
- •Installation media
- •Initial selections
- •Installation type or class
- •Disk partitioning and formatting
- •Installing LILO
- •Network configuration
- •User accounts
- •Authentication methods
- •Package selection and installation
- •A Dual-Boot Installation of Linux
- •Linux with Microsoft Windows
- •Linux with Microsoft Windows NT and 2000
- •Linux and Solaris
- •Linux and other operating systems
- •Installing Additional Software with gzip and tar
- •Installing Additional Software with RPM
- •Removing software with RPM
- •Upgrading software with RPM
- •Query the RPM software
- •Verify the RPM software
- •Verify the package files
- •Upgrading the Kernel
- •Upgrading a Linux Kernel
- •System Log Files
- •The Final Test of the Installation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •What is the X Window System?
- •The X Window System
- •X Client and Server communications
- •X Window Manager
- •Configuring X Window Systems
- •Custom X Window System Programs
- •Manual Configuration of the X Window System
- •Documentation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Basic Network Services
- •TCP/IP Protocol Suite
- •Connection protocols needed
- •Other network protocols
- •Configuring Basic Network Services
- •Host name
- •IP addressing
- •DHCP
- •Netmask
- •Hardware resources
- •Routing and gateways
- •PPP, SLIP and PLIP connections
- •Server Tasks with
- •IP aliases for virtual hosts
- •Apache Web Server
- •Samba File Server
- •Home directories
- •Disk shares
- •Configuring Client Services
- •SMB/CIFS
- •NIS client configuration
- •NFS client configuration
- •Configuring Internet Services
- •Web browser
- •POP and SMTP
- •TFTP
- •SNMP
- •Remote Access
- •Rlogin
- •Telnet
- •OpenSSH
- •Documentation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Adding Hardware
- •Memory
- •Swap
- •Adding a hard drive
- •Video and monitor
- •Printers
- •Configuration files
- •Setting environment variables
- •BASH
- •Documentation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Basic User and Group Administration
- •What are users and groups?
- •Creating users
- •Change user information
- •Deleting users
- •Creating groups
- •Getting Around Linux
- •Navigating Linux
- •Common file and directory commands
- •Setting File and Directory Permissions
- •Mounting and Managing File Systems
- •Mount
- •Umount
- •Mounted file systems
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Multi-User Environment
- •The creation of Virtual Consoles
- •The Linux Terminal Server Project
- •Configurations for remote systems
- •Monitoring remote connections
- •Common Shell Commands
- •Basic shell scripts
- •Caution using root access
- •Navigating the GUI interface
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Linux Runlevels
- •init
- •Shutting down Linux
- •Managing Linux Services
- •Configuring Linux Printing
- •lpd daemon
- •/etc/printcap
- •Printing management
- •Using the vi Editor
- •vi operation modes
- •Editing text files
- •Using the
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Disk and File System Management
- •Repairing Partitions
- •System Automation and Scheduling
- •cron
- •Core Dumps
- •Analyzing core dumps
- •GNU Debugger
- •Managing Networking Interfaces
- •Installing System Packages and Patches
- •Compressed archive
- •Debian Package Installer
- •Slackware Package Installation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Linux Processes
- •Core services versus non-critical services
- •Process administration
- •Process control
- •Monitoring Log Files
- •Maintaining Documentation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Linux Security
- •Securing the Environment
- •Location
- •Environment
- •System Security
- •System/user files
- •Permissions
- •Log auditing
- •Backups
- •Linux Security Best Practices
- •Network security
- •Firewall
- •System security
- •Securing a Web server
- •Securing an FTP server
- •FTP program version
- •FTP configuration files
- •Process security
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Disaster Recovery Planning
- •Types of data
- •Frequency and Scheduling
- •Storage and media types
- •Recovering data
- •Offsite storage
- •Linux Backup Tools and Commands
- •Third party tools
- •Tape devices
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Identifying the Problem
- •Methodology and Best Practices
- •Troubleshooting Resources
- •Documentation resources
- •Internet resources
- •System Log Files
- •Tools for Log Files
- •Output to another file
- •Locating files
- •Process Configuration and Management
- •Stopping, Starting, and Restarting Processes
- •Configuration Files
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Examining the Startup Process
- •Boot process steps
- •Analyzing Boot Process Errors
- •Common Boot Problems
- •Using System Status Tools
- •File System Check
- •System Resource Commands
- •Using the System Boot Disk
- •Types of boot disks
- •Creating a boot disk
- •Creating a rescue/utility disk
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Common User Problems
- •Login problems
- •File and directory permissions
- •Printing problems
- •Mail problems
- •Software Package Problems
- •Package dependencies
- •Software and version conflicts
- •Backup and Restore Errors
- •Backup hardware
- •Backup software
- •File restore errors
- •Application Failures
- •Log files
- •Process and daemon errors
- •Web server errors
- •Telnet
- •Mail services
- •Basic Networking Troubleshooting
- •Networking connectivity
- •Network hardware problems
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Mainboard Components
- •BIOS
- •System memory
- •System Resources
- •I/O addresses
- •Direct memory access
- •Laptop Considerations
- •PCMCIA
- •Linux Peripheral Configuration
- •Installing and Configuring SCSI Devices
- •SCSI definitions
- •SCSI technologies
- •SCSI cabling and termination
- •SCSI device configuration
- •Linux SCSI devices
- •ATA/IDE Devices
- •IDE drive configuration
- •Linux ATA/IDE Drive configuration
- •Linux Support for Other Devices
- •IEEE 1394 (Firewire)
- •Summary
- •Assessment Questions
- •Scenarios
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •What’s on the CD-ROM
- •System Requirements
- •Using the CD with Microsoft Windows
- •Using the CD with Linux
- •Microsoft Windows applications
- •Linux applications
- •Troubleshooting
- •Sample Exam
- •Exam Questions
- •Exam Answers
- •Taking a CompTIA Exam
- •How to register for an exam
- •What to expect at the testing center
- •Your exam results
- •If you don’t receive a passing score
- •About the Linux + Exam
- •Preparing for the Linux+ Exam
- •For More Information
- •Preamble
- •No Warranty
- •Glossary
- •Index
286 Chapter 8 Study Guide
Lab Exercises
Lab 8-1 Using the VI editor
The objective for this hands-on lab is to gain experience in using the VI editor. You should be able to use any distribution of Linux for this installation exercise.
1.Log into a Linux system with only user rights.
2.Use VI to create a simple text file.
3.Practice using the common commands within VI.
4.When you’re comfortable with the VI editor, open a system file for editing. Be sure to back up the file first.
5.Save the file after editing.
6.Restore the previous file.
7.Repeat as needed until you’re comfortable with the VI editor.
Lab 8-2 Adding a hard drive
The objective for this hands-on lab is to gain experience installing a hard drive, partitioning it, creating a file system, mounting it, and editing a system file to use the newly created file system. You should be able to use any distribution of Linux for this installation exercise.
1.Install a hard drive.
2.Partition the hard drive.
3.Create a file system on the drive.
4.Mount the file system.
5.Edit the system file to auto mount the newly created drive on boot.
Answers to Chapter Questions
Chapter Pre-test
1.PATH is used to set the directories searched for any command entered.
2.TERM environment variable is used to set name of the terminal, console, or display-device type to be used.
3.The swap file should be configured to support the system memory and user applications.
Chapter 8 Study Guide 287
4.The inittab file is normally stored in the /etc directory.
5.The fstab file is normally stored in the /etc directory.
6.A basic editor included with Linux is VI.
7.Multiple shells can be used on the same system and even by the same user.
8.BASH (Bourne Again SHell) is the shell, or command language interpreter, for the GNU operating system and is standard for most Linux systems.
9.Before editing any system files, you should back them up to a safe location first, so that you can recover the original if you make an error.
10.The main use of a shell is to provide services, including command and filename completion, command line editing, history commands and events, detailed shell operational control, and aliasing.
Assessment Questions
1.B. Typically, the size of the swap file should be twice the size of installed RAM. For review, see the “Adding Hardware” section.
2.B. The command cp fstab fsold backs up the fstab file. The others won’t work to back up the file. For review, see the “Memory” section.
3.C. The <esc> key is used to exit edit mode in VI. The others are used to perform different VI functions. For review, see the “VI” section.
4.D. The command string that will exit VI without saving the changes is: q!. The : w! overwrites the file and the others are not used. For review, see the “VI” section.
5.B. The mkswap /dev/<partition> command is used to activate the swap partition. The other commands don’t activate the swap partition. For review, see the “Swap” section.
6.C. The options for IDE drive addressing are Master, Slave, and Cable Select — not only Master and Slave. The numbering system 0-7 and 0-15 are used
in SCSI addressing. For review, see the “Adding a hard drive” section.
7.B. The SCSI ID that matches sdc is 2. SCSI ID 1=sdb, 3=sdd, and 4=sde. For review, see the “Adding a hard drive” section.
8.B. There are 8 SCSI IDs on a narrow SCSI bus. For review, see the “Adding a hard drive” section.
9.D. There are 16 SCSI IDs on a wide SCSI bus. For review, see the “Adding a hard drive” section.
10.A. The mkfs command is used to create file systems. The cfdisk command creates partitions, linuxconf is used to configure the Linux system, and format is not a standard Linux command. For review, see the “Adding a hard drive” section.
288 Chapter 8 Study Guide
11.B. The daemon that processes print requests is the line printer spooler daemon. For review, see the “Printers” section.
12.D. The fstab file is used to automatically mount file systems. The others are not functions of fstab. For review, see the “Adding a hard drive” section.
13.C. The /etc/inittab file is used to perform the default state and terminal connections for a Linux system. The inittab file does not perform the other functions. For review, see the “Configuration files” section.
14.D. The env command will display the current active shell. The others are not used to verify the active shell. For review, see the “BASH” section.
15.A. The line SHELL=/bin/bash indicates that the BASH shell is the default shell. For review, see the “BASH” section.
16.B. The bashrc file is usually located in the /etc directory. It is not normally in the other directories. For review, see the “BASH” section.
17.D. The . bashrc file is usually located in the /home/username directory. It is not normally in the other directories. For review, see the “BASH” section.
18.A. The function of the . bash_profile file is to provide login initialization commands. For review, see the “BASH” section.
19.D. The function of the . bash_logout is to provide logout functions. For review, see the “BASH” section.
20.B. The function of the . bashrc file is to provide shell configuration commands. For review, see the “BASH” section.
Scenarios
1.The use of multiple shells is supported and can be configured by placing the appropriate files in the user’s home directory and creating the proper configuration files. For review, see the “BASH” section.
2.You should install the hard drive, partition the disk, create a file system on the partition, mount the partition, and add any additional configurations.
Administration
Administrating a Linux network environment will be a common task. You will have to add new users and
delete former users. You will also have to issue passwords and set the proper permissions for each user or group. The chapters in this part detail the common tasks that an administrator must know how to perform in order to keep the network (and the users on it) running smoothly. Every day, you will have to use common shell commands; create, extract, and edit files; manage run levels; and even start, stop, and restart services. On the Linux+ exam, 18 percent is focused on administration but understanding the basic functions of the common administration commands and being able to navigate the Linux hierarchy will get you one step closer to being a Linux professional and passing the Linux+ exam.
P A R T
IV
In This Part
Chapter 9
General Linux
Administration
Chapter 10
Linux Terminals and
Shells
Chapter 11
Linux System
Commands
General Linux
Administration
EXAM OBJECTIVES
4.1 Create and delete users
4.2 Modify existing users (e.g., password, groups, personal information)
4.3 Create, modify and delete groups
4.4 Identify and change file permissions, modes and types by using chmod, chown and chgrp
4.5 Manage and navigate the Linux hierarchy (e.g., /etc, /usr, /bin, /var)
4.6 Manage and navigate the standard Linux file system (e.g., mv, mkdir, ls, rm)
4.8 Mount and manage filesystems and devices (e.g., /mnt, /dev, du, df, mount, umount)
C 9H A P T E R
292 Part IV Administration
CHAPTER PRE-TEST
1.Creating a user normally requires what information?
2.Creating a group of users normally requires what information?
3.What commands or programs are most often used to create users?
4.What commands or programs are most often used to create groups?
5.What are the common directories in Linux?
6.What commands are used to manage and navigate files and directories?
7.What commands are used to mount and manage file systems?
8.What commands are used to identify and manage file permissions?
9.Which of the commands that are used to manage users, groups, directories, file systems, and permissions, do not require the use of root privileges?
10.What commands can be used to manage users and files without the need for root access?
Answers to these questions can be found at the end of the chapter.