- •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
154 Part II Installation
switch. The -U is really a combination of the -i and -e switches, and because of this, you can use it to install packages even when you have no upgrade to perform. The upgrade does not erase any files that are normally removed during an upgrade; therefore, it still installs the package by using the installation feature of upgrading. This is why many people who have used RPM for years may not use the -i switch to install packages; instead, they use the -U switch to perform installations and upgrades.
Query the RPM software
The query command in RPM allows you to query what has been installed, upgraded, and erased. This is a powerful tool, which you can use to query files for an individual package or to learn all the packages that are installed on the system. Table 5-6 shows the switches that are used with RPM and the query command.
Table 5-6
Red Hat Package Manager Query Commands
Switches used with |
Switch performs this task |
the rpm command |
|
|
|
-q or --query |
Query the installed package(s) |
|
|
-a |
Query all installed packages |
|
|
-c |
Display a list of configuration files |
|
|
-d |
Display a list of documentation files |
|
|
--dbpath <path> |
Use <path> to find RPM database |
|
|
--dump |
Display all verifiable information about each file |
|
|
-f <file> |
Query package owning <file> |
|
|
-g <group> |
Query packages belonging to <group> |
|
|
-i |
Display summary package information |
|
|
-l |
Display a list of the files in a package |
|
|
<null> |
Display full package label |
|
|
-p <file> (or “-”) |
Query a package <file> (URLs are okay here) |
|
|
--provides |
Display the capabilities the package provides |
|
|
--qf or --queryformat |
Display the queried data in a custom format |
|
|
-R or --requires |
Display the capabilities requirement of the package |
|
|
--rcfile <rcfile> |
Set alternate rpmrc file to <rcfile> |
|
|
-s |
Displays the state of each file in the package |
|
|
--scripts |
Show the scripts associated with a package |
Chapter 5 Advanced Installation 155
Switches used with |
Switch performs this task |
the rpm command |
|
|
|
--root <path> |
Set alternate root to <path> |
|
|
-v |
Display additional information |
|
|
-vv |
Display debugging information |
|
|
--whatprovides <x> |
Query packages providing capability <x> |
|
|
--whatrequires <x> |
Query packages requiring capability <x> |
|
|
The ability to query the installed files is a very useful tool because you can learn which version of the C libraries is installed on a system. The following is an example:
[root@localhost /root]# rpm -q tar tar-1.13.19-4
[root@localhost /root]#
You can also use the query command to see all the RPM packages on the system; the following is an example:
[root@localhost /root]# rpm -qa |more indexhtml-7.1-2
specspo-7.1-1 pciutils-devel-2.1.8-19 cdda2wav-1.9-6 db3-3.1.17-7 gdbm-1.8.0-5 libjpeg-6b-15 mailx-8.1.1-20 esound-0.2.22-1 mpg123-0.59r-10 at-3.1.8-16 less-358-16 netpbm-9.9-5 playmidi-2.4-12 aspell-0.32.6-2 rmt-0.4b21-3 setserial-2.17-2 ntsysv-1.2.22-1 tar-1.13.19-4 mount-2.10r-5 crontabs-1.9-2 wget-1.6-2 cyrus-sasl-1.5.24-17 --More--
156 Part II Installation
In the preceding example, notice the use of the pipe (|) and more commands; if these options are not used, the list of RPM packages scrolls by very quickly. Finally, the query command is so useful because it has this format: The query is first, then the files to be queried, and finally the information to be queried for.
Verify the RPM software
2.19 Validate that an installed application is performing correctly in both a test and a production environment
You can also use RPM to verify that the software on the system is in working order. Use this verify command to make sure that the packages are still configured properly, to verify that no changes have been made to the system, or to verify that an accidental remove of files did not damage the system. Table 5-7 lists the switches that are used with the verify command.
Table 5-7
Red Hat Package Manager Verify Commands
Switches used with |
Switch performs this task |
the rpm command |
|
|
|
-V or --verify |
Verify the installed package(s) |
|
|
-a |
Verify all installed packages against the RPM database |
|
|
--dbpath <path> |
Use <path> to find RPM database |
|
|
-f <file> |
Verify package owning <file> |
|
|
-g <group> |
Verify the packages belonging to <group> |
|
|
--nodeps |
Do not check dependencies during verification |
|
|
--nofiles |
Do not verify file attributes |
|
|
--noscripts |
Do not execute verification scripts |
|
|
-p <file> (or “-”) |
Verify against a specific package <file> |
|
|
--rcfile <rcfile> |
Set alternate rpmrc file to <rcfile> |
|
|
--root <path> |
Set alternate root to <path> |
|
|
-v |
Display additional information |
|
|
-vv |
Display debugging information |
|
|
The verify command is very important in the installation of Linux because it enables the installer to verify that all packages are installed correctly. You can use the following command to verify all RPM packages installed on the system during installation or when adding packages.
Chapter 5 Advanced Installation 157
[root@localhost /root]# rpm -Va |more
.M...... |
|
/var/spool/at/.SEQ |
S.5.... |
T c /usr/share/a2ps/afm/fonts.map |
|
S.5.... |
T |
/boot/kernel.h-2.4.2 |
....... |
T |
/lib/modules/2.4.2-2/modules.dep |
....... |
T /lib/modules/2.4.2-2/modules.generic_string |
|
....... |
T |
/lib/modules/2.4.2-2/modules.isapnpmap |
....... |
T |
/lib/modules/2.4.2-2/modules.parportmap |
....... |
T |
/lib/modules/2.4.2-2/modules.pcimap |
....... |
T |
/lib/modules/2.4.2-2/modules.usbmap |
missing |
|
/etc/identd.key |
S.5.... |
T c /etc/X11/fs/config |
|
missing |
|
/usr/share/ssl/certs/stunnel.pem |
Do not be surprised that some files won’t be verified, because RPM is very strict about passing the verification.
Verify the package files
The files contained in a package may be just as important as the verification of the package. To verify the individual files, answer the following questions:
Is the organization listed?
Have unauthorized changes been made to it?
Can it be trusted not to compromise the system?
You can resolve these questions with the file verification command. Table 5-8 shows the switches for this command.
|
Table 5-8 |
|
Red Hat File Verify Commands |
|
|
Switches used with |
Switch performs this task |
the rpm command |
|
|
|
-K or --checksig |
Verify one or more package files |
|
|
--nopgp |
Do not verify any PGP signatures |
|
|
--rcfile <rcfile> |
Set alternate rpmrc file to <rcfile> |
|
|
-v |
Display additional information |
|
|
-vv |
Display debugging information |
|
|