- •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
338 Part IV Administration
[ws001] |
|
|
XSERVER |
= XF86_SVGA |
|
X_MOUSE_PROTOCOL |
= “Microsoft” |
|
X_MOUSE_DEVICE |
= “/dev/ttyS1” |
|
X_MOUSE_RESOLUTION = 50 |
||
X_MOUSE_BUTTONS |
= 3 |
|
X_MOUSE_BAUD |
|
= 1200 |
[ws002] |
|
|
XSERVER |
= XF86_Mach64 |
|
[ws003] |
|
|
XSERVER |
= XF86_SVGA |
|
X_COLOR_DEPTH |
|
= 24 |
USE_XFS |
= N |
|
[ws004] |
|
|
UI_MODE |
= CHAR |
These parameters are used to create a basic configuration that allows the creation of terminals. These terminals may be GUI-based and can be configured to perform all the tasks required by the clients.
Monitoring remote connections
4.11 Use network commands to connect to and manage remote systems (e.g., telnet, ftp, ssh, netstat, transfer files, redirect Xwindow)
FTP, HTTP, TELNET, and ssh create remote connections to a system. They allow you to be able to login and use the remote machine as if you were sitting physically at the console.
Telnet
Telnet is a terminal emulation program for clients running on TCP/IP networks. It connects you to a terminal on another machine. This connection allows you to enter commands on that machine as if you were at the actual physical console. To connect to a host called server1, you would enter the command:
telnet server1
You should then receive a login prompt from where you can log into the system and start entering commands. To exit out of the telnet command, you simply have to logout, or use the quit command.
FTP
FTP (File Transfer Protocol) is a protocol that is part of the TCP/IP suite. It allows you to connect to a remote host and transfer files to or from the remote host. For example, to connect to a host called server1, you would enter the command:
Chapter 10 Linux Terminals and Shells 339
ftp server1
This command will connect you to the FTP server process on server1, which will prompt you with a login. Once logged into the system, you can use the cd and ls commands to traverse and examine the directories on the system. Retrieving files from the remote host is accomplished by the get command. Uploading a file to the host is accomplished by using the put command.
SSH
SSH (secure shell) is similar to telnet, in that you use it to connect to a remote machine, but in this case, the communications and authentication are encrypted to prevent someone from listening in to the session.
X remote login
The X Windows system allows for remote X logins to other hosts, and also allows the ability of a client to run an X Windows session on another machine. For example, if you need to start an X login with server1, you would use the command:
X -query server1
You can also redirect your own display to a remote host, as long as the appropriate permissions are in place. For example, your client (client1) wants to open up an X Window on server that is from your client machine. First, the server has to give you permissions to do this:
xhost + client1
Now, you have to use the DISPLAY command to export your display:
DISPLAY=server1:0 xterm &
This command starts xterm in background mode (&), so you will not interfere with the main X session that is running on the server.
Netstat
The connections from these services, such as telnet, ssh, and ftp, may require detection by an administrator, so that any unauthorized attempts at logging in can be seen and logged. One of the most common tools used to perform this task is netstat. The netstat command provides information similar to the following:
[user@dhcppc1 user]$ netstat |
|
|
|
|
||||
Active Internet connections (w/o servers) |
|
|||||||
Proto Recv-Q Send-Q Local Address |
|
Foreign Address |
State |
|||||
tcp |
0 |
0 |
192.168.0.7:telnet |
192.168.0.8:blackjack ESTABLISHED |
||||
tcp |
0 |
20 192.168.0.7:ssh |
|
192.168.0.6:1137 ESTABLISHED |
||||
Active UNIX domain sockets (w/o servers) |
|
|||||||
Proto RefCnt Flags |
Type |
State |
I-Node Path |
|
||||
unix 8 |
|
[ ] |
DGRAM |
|
10679 /dev/log |
|
340 Part IV Administration
unix 2 |
[ ] |
DGRAM |
16916 |
|
|
unix 3 |
[ ] |
STREAM |
CONNECTED |
16330 |
/tmp/.X11-unix/X0 |
unix 3 |
[ ] |
STREAM |
CONNECTED |
16329 |
|
unix 3 |
[ ] |
STREAM |
CONNECTED |
16321 |
/tmp/.font-unix/fs-1 |
unix 3 |
[ ] |
STREAM |
CONNECTED |
16320 |
|
unix 3 |
[ ] |
STREAM |
CONNECTED |
16322 |
/tmp/.X11-unix/X0 |
unix 3 |
[ ] |
STREAM |
CONNECTED |
16317 |
|
unix 2 |
[ ] |
DGRAM |
15166 |
|
|
unix 2 |
[ ] |
DGRAM |
14346 |
|
|
unix 2 |
[ ] |
DGRAM |
11463 |
|
|
unix 2 |
[ ] |
DGRAM |
10704 |
|
|
unix 2 |
[ ] |
DGRAM |
10691 |
|
|
unix 2 |
[ ] |
STREAM |
CONNECTED |
10101 |
|
This output shows some of the current active UNIX domain sockets and remote hosts. In this example, the remote hosts use TELNET and ssh to connect to the system. Netstat is a powerful tool that uses the options shown in Table 10-1.
|
Table 10-1 |
|
Netstat Options |
|
|
Option |
Description |
|
|
No Options |
By default, netstat displays a list of open sockets. |
|
|
-a --all |
Shows both listening and non-listening sockets. |
|
|
-A --protocol=family |
Specifies the address families for which connections are to be |
|
shown. |
|
|
-c --continuous |
Causes netstat to print the selected information every second |
|
continuously. |
|
|
-C |
Prints the routing information from the route cache. |
|
|
-e --extend |
Displays additional information. |
|
|
-F |
Prints routing information from the FIB. |
|
|
-g --groups |
Displays multicast group membership information for IPv4 and |
|
IPv6. |
|
|
-I --interface=iface |
Displays a table of all network interfaces, or the specified iface. |
|
|
-l --listening |
Shows only listening sockets. |
|
|
-M --masquerade |
Displays a list of masqueraded connections. |
|
|
-n --numeric |
Shows numerical addresses instead of trying to determine |
|
symbolic host, port, or user names. |
|
|
--numeric-hosts |
Shows numerical host addresses but does not affect the |
|
resolution of port or user names. |
|
|