- •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
352 Chapter 10 Study Guide
Lab 10-2 Creating cron jobs
The objective for this hands-on lab is to gain experience in creating cron jobs. You should be able to use any distribution of Linux for this installation exercise.
1.Create several crontab compatible files to perform some routine tasks.
2.Use the crontab command to activate the cron jobs.
3.Verify that the jobs run correctly.
4.Repeat as often as needed.
Answers to Chapter Questions
Chapter Pre-test
1.Linux is a true multi-user environment that allows multiple users to access a system locally or remotely at the same time.
2.Linux includes the ability to use virtual terminals, multiple logins, and remote logins all on the same system at the same time.
3.Linux uses virtual consoles, serial terminals, and Ethernet workstations to allow multiple users access to the same system.
4.Linux can provide Ethernet terminals by using the tools available through the Linux Terminal Server Project.
5.Linux can use netstat to monitor remote connections.
6.The most common shells used in Linux today are BASH, PDKSH (often known as Korn Shell), TCSH, and Z-shell.
7.The BASH or Bourne Again SHell is the most common shell used in Linux.
8.A script can be created to perform repetitive tasks on a Linux system.
9.The use of the cron daemon and crontab command to convert shell commands into scheduled tasks is available on a Linux system.
10.The “best practice” way to login as the root user on a Linux system is to use a standard user account and then the su command to gain root access.
Assessment Questions
1.B. The keystrokes used to move from one virtual console to another is the <Alt> <Fx> combination. The other combinations don’t normally produce the desired effect. For review, see the “Multi-User Environment” section.
Chapter 10 Study Guide 353
2.C. Linux normally provides the ability to support 63 virtual consoles. The others are not correct for the standard Linux environment. For review, see the “The creation of Virtual Consoles” section.
3.D. A terminal server can provide the desired terminals. DHCP provides dynamic IP addresses, Samba provides services for Microsoft Windows clients, and Virtual Consoles are not normally considered the most inexpensive method of providing consoles. For review, see the “The Linux Terminal Server Project” section.
4.A. The download of the Linux kernel is performed via tftp when using the LTSP method of creating terminals. The abilities of ftp to transfer files are not used, and DHCP and bootp are used to provide IP addresses. For review, see the “The Linux Terminal Server Project” section.
5.C. The file /etc/inittab is used to adjust the number of virtual consoles. The other files are not used to adjust the number of virtual consoles. For review, see the “The creation of Virtual Consoles” section.
6.A and C. The bootp and DHCP services are used to provide IP addresses for the LTSP systems. For review, see the “Configurations for remote systems” section.
7.B. The Etherboot package may be used to create network bootable terminals for the Linux Terminal Server Project system. The lts_core package is the LTSP package, the XDM is a Linux system used to provide terminal logins, and syslogd controls the system messages. For review, see the “Configurations for remote systems” section.
8.D. The netstat command is used to monitor connections to a Linux system. The nbstat, tracert, and ipconfig programs are not normally used in the Linux environment. For review, see the “Monitoring remote connections” section.
9.A and D. The Bourne Again SHell uses features of the Korn and C shell. The others are available shells for Linux. For review, see the “Common Shell Commands” section.
10.C. The bash executable is normally located in /bin/bash. For review, see the “Common Shell Commands” section.
11.B. The daemon used to perform automatic tasks is the cron daemon. The crontab command is used with cron, cron.d is one of the support files systems, and crontab.d is normally not used in the Linux environment. For review, see the “Basic shell scripts” section.
12.A. The correct way to indicate a shell script is to use #!/bin/sh at the beginning of the file. For review, see the “Basic shell scripts” section.
13.B. The su command allows not only the ability to login as the root user but as any user on a system. The vi command is an editor, chmod is used to administer user accounts, and chuser is not a normal Linux command. For review, see the “Caution using root access” section.
354 Chapter 10 Study Guide
14.D. The opening of a terminal in Linux can be used to provide a command line in the GUI. For review, see the “Navigating the GUI interface” section.
15.C. The package that is used to install the LTSP is lts_core and the others are not. For review, see the “Configurations for remote systems” section.
16.A. The command rpm -i lts_core-2.XX-XX.i386.rpm will install the Linux Terminal Server Project core packages. The others won’t work because the options -I, -e and -u don’t install packages. For review, see the “Configurations for remote systems” section.
17.A. The line S2:3:respawn:/sbin/uugetty ttyS2 M19200 is the only line that will create a virtual console on a serial port to allow modem or external connections. For review, see the “Configurations for remote systems” section.
18.B. The file /etc/dhcpd.conf.example provides a starting point for the configuration file needed to start the DHCP service. The others are not provided to help start the DHCP service. For review, see the “Configurations for remote systems” section.
19.B. The need for a firewall is created to protect the LTSP server from outside access. A router can provide a firewall but does not always do so, tftp allows the download of the Linux kernel, and portmapper does not protect the system. For review, see the “Configurations for remote systems” section.
20.D. The file that provides most of the workstation information is /tftpboot/ lts/ltsroot/etc/lts.conf. For review, see the “Configurations for remote systems” section.
Scenarios
1.The use of a system of Linux Terminal Servers will resolve most of the future cost needs. Because the servers provide the system resources such as processing and disk space, only the servers must be upgraded to provide most performance enhancements.
2.The creation of a virtual console on a serial port can allow remote access to a Linux system and provide some diagnostic abilities before traveling to the site.
Linux System 11C H A P T E R
Commands
EXAM OBJECTIVES
4.12 Create, extract and edit file and tape archives using tar
4.13 Manage runlevels using init and shutdown
4.14 Stop, start, and restart services (daemons) as needed (e.g., init files)
4.15 Manage print spools and queues
4.16 Create, edit and save files using vi
356 Part IV Administration
CHAPTER PRE-TEST
1.What is the purpose of the tar command?
2.What does runlevel 0 indicate?
3.Why should the Linux system be shut down properly?
4.What process runs the print spooler?
5.Where are most startup scripts located?
6.What do “S” and “K” stand for when naming scripts?
7.How do you enter command mode in the vi editor?
8.What runlevel does the Graphical User Interface run at?
9.What command do you use to print from the command line?
10.How do you extract a tape archive file?
Answers to these questions can be found at the end of the chapter.
