
- •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

Chapter 12 Linux Disk and System Management |
395 |
To enable the interface, use the following command:
ifconfig eth0 up
The following list includes some of the options that you can set with the ifconfig command:
interface: The name of the interface.
up: This flag causes the interface to be activated.
down: This flag causes the driver for this interface to be shut down.
[-]arp: Enable or disable the use of the ARP protocol on this interface.
[-]promisc: Enable or disable the promiscuous mode of the interface. If selected, all packets on the network will be received by the interface.
[-]allmulti: Enable or disable all-multicast mode. If selected, all multicast packets on the network will be received by the interface.
metric N: This parameter sets the interface metric.
mtu N: This parameter sets the Maximum Transfer Unit (MTU) of an interface.
netmask addr: Sets the IP network mask for this interface.
[-]broadcast [addr]: If the address argument is given, set the protocol broadcast address for this interface.
address: The IP address to be assigned to this interface.
You don’t need to use all the options of the ifconfig command, but know how to configure a basic ethernet or loopback interface.
Installing System Packages and Patches
5.5 Download and install patches and updates (e.g., packages, tgz)
Upgrading a system service or application is a common task for an administrator. You may need to upgrade a package or install a system or application patch for many reasons, including:
Bug Fixes: Most upgrades fix a number of program bugs since the last release of the program. This ensures that you are using the most current stable version.
Enhanced Functionality: Most new upgrades enhance the functionality of the program. This will help the user base by giving them additional tools with which to enhance their work.

396 Part V Maintaining the Linux System
Increased Security: Many programs come with severe security flaws. These are usually patched up in later releases. It is extremely important to keep your programs up-to-date regarding security enhancements.
Any type of system upgrade or patch that you perform should take place during offhours, so as not to affect the users. If users are logged into the system with files open, an upgrade or patch may cause data corruption — because you may need to stop or restart a program or service, or reboot the system. Remember to mention any upgrades or system maintenance in the “Message of the Day” file in /etc/motd. This reminds users to log off before they leave work, so no files will be open.
Software packages come in many different types. The most common method for packaging a group of files is using the tar and gzip utilities to create an archive file and compress it. These files are denoted by the extension tar.gz. Some distributions offer their own packaging format, such as RPM (Redhat Package Manager), or Slackware, which uses a modified tar and gzip package with the extension .tgz.
Compressed archive
Most programs and patches come in the form of a compressed archive. A program patch or upgrade contains several source code files, binaries, and program libraries. A compressed archive consists of all the files that are part of the update, tied together in a single file called a tar archive.
One problem with tar is that it doesn’t actually compress the files in the archive; therefore, they can often be very large in size, which makes them more difficult to download over slow Internet connections, and impossible to fit on a floppy disk. To compress the archive, use the gzip utility. This utility compresses the data in a file into the smallest possible form. When used in conjunction with the tar utility, you can create a collection of files, and then compress them so that you only need one small file.
The resulting file has a .tar.gz extension, indicating that it is a tar file that has been compressed with gzip. To extract the file, use the gunzip command to unzip the file:
gunzip packagename.tar.gz
After the command completes, the file will be unzipped, and the remaining product is the tar archive file. Then, you can use the tar command to extract the files from the archive:
tar -xvf packagename.tar
The tar utility also comes with the capability of unzipping the archive while extracting files at the same time. To do this, use the -z switch:
tar -zxvf packagename.tar.gz

Chapter 12 Linux Disk and System Management |
397 |
Performing the gunzip and tar extract commands together is a lot easier than using the two separate commands to extract and unzip the files.
After the file has been extracted, be sure to read the documentation before installing the upgrade or patch. Typically, a README file will give you installation instructions.
From the README file, you may have to compile the source code into a binary, and then execute the binary to start your upgrade or patch. Often, this process can be very tedious and time-consuming.
1.Run the configure command. This prepares the system for installation, and ensures that you have the proper compiler and any other dependencies for the operation.
2.Use the make command to compile the source code into binary format.
3.Use the make install command. This command installs your binary in the proper location.
After you finish, you can remove the original source files and the compressed file.
RPM
The RPM (Redhat Package Manager) format is another type of package installation. RPM is a utility that streamlines the method for installing applications, upgrades, and patches.
By installing an application through RPM, you only need to activate one command to uncompress and install your application package. You don’t need to use tar, gzip, or tediously compile source code. The RPM manager does all this automatically. Although created by Redhat, the RPM format is used by many different distributions for package installation.
RPM packages come with the extension .rpm. To install it, simply use the install option:
rpm -i packagename.rpm
To see more information when installing, use the verbose and hash mark options, which allow you to see a better view of what is being installed.
rpm -ivh packagename.rpm
If you have an existing application that you want to upgrade, use the upgrade option. If the application doesn’t already exist, it will install anyway.
rpm -Uvh packagename.rpm

398 Part V Maintaining the Linux System
To delete an application installed through RPM, use the erase function. This quickly and efficiently removes your application entirely:
rpm -e packagename.rpm
Only update a package or install a patch if you are currently experiencing issues that are fixed by the update. Needlessly updating an application or applying a patch can often lead to system problems that you aren’t prepared for.
Debian Package Installer
Packages for the Debian Linux distribution have the extension .deb. To install or manipulate these files, use the dpkg utility.
To install a Debian package, use the following command: dpkg -i packagename.deb
To obtain a list of files that are contained in the package without installing them, use the following command:
dpkg -L packagename.deb
To remove or uninstall a package, use the following command: dpkg -r packagename.deb
Slackware Package Installation
Slackware’s package management system utilizes .tgz files as its package format. Although the type of file is very similar to a standard tar.gz file, and can be unzipped and untarred as usual, the resulting package is only intended for installation on a Slackware system.
You can install Slackware packages by using a menu-driven tool called pkgtool. From the command line, you can use different utilities, depending on what you want to do with the package. For example, to install a package, use the following command:
installpkg packagename.tgz
The installpkg utility comes with an excellent installation option, which shows you what happens if you install a particular package. The “warn” option allows you to test a package before installing on a production system. To test install the package, use the following command:
installpkg -warn packagename.tgz
To remove a package from a system, use the removepkg command:
removepkg packagename