Using Linux Commands

Civilization Call to Power

You can build online civilizations with Civilization Call to Power (CCP). Like earlier versions and public spin-offs (such as the Freeciv described earlier in this chapter), Civilization Call to Power for Linux lets you explore the world, build cities, and manage your empire. This latest version offers multiplayer network competition and extensions that let you extend cities into outer space and under the If you like the Freeciv game that comes with Red Hat Linux, you will love CCP. Engaging...

Using the Nautilus file manager

At one time, file managers did little more than let you run applications, create data files, and open folders. These days, as the information a user needs expands beyond the local system, file managers are expected to also display Web pages access FTP sites and play multimedia content. The Nautilus file manager, which is the default GNOME file manager, is an example of just such a file manager. When you open the Nautilus file manager window (from the GNOME main menu or by opening the Home icon...

Configuring Port Sentry

Chances are that you will want to make some changes to the way that PortSentry runs. To change how PortSentry behaves, modify the etc portsentry portsentry.conf file. In that file, you can choose which ports to monitor, the mode in which to monitor, and the responses to take when a scan is detected. The responses can include Blocking access by the remote computer Rerouting messages from the remote computer to a dead host Adding a firewall rule to drop packets from the remote computer The other...

Creating an Image Gallery with Konqueror

There's a neat feature in Konqueror that lets you create a quick image gallery. The feature takes a directory of images, creates thumbnails for each one, and generates an HTML (Web) page. The HTML page includes a title you choose, all image thumbnails arranged on a page, and links to the larger images. Here's how you do it 1. Add images you want in your gallery to any folder (for example, home jake images). Make sure they are sized, rotated, and cropped the way you like before beginning. (Try...

Turning on iptables

To turn on iptables, you might have to turn off ipchains. (This might be the case if youjust upgraded from a release prior to Red Hat Linux 8, where ipchains was the default.) Then you can add the modules and create the rules you need for your iptables firewall. The following procedure describes how to get iptables going on your Red Hat Linux system. Tip During the time that you turn off ipchains, turn on iptables, and configure the filtering rules for iptables, your computer may be unprotected...

Using your camera as a storage device

Instead of using gtkam or gphoto to download pictures to Linux, some digital cameras let you treat them like a storage device to manage pictures. By mounting a digital camera as a USB mass storage device, you can view, copy, delete, and move the pictures on your camera as you would files on a hard disk or CD (just at a lower speed). The following is a partial list of digital cameras that can be used as a USB storage device Casio Supported models QV-2400UX, QV-2x00, QV-3x00, QV-4000 and QV-8000....

Using Scanners Driven by SANE

Software for using a scanner with Linux is being driven by an effort called Scanner Access Now Easy (SANE). This effort hopes to standardize how device drivers for equipment such as scanners, digital still cameras, and digital video cameras are created, as well as help simplify the interfaces for applications that use those devices. SANE is now included with the Red Hat Linux distribution. The sane-backend and sane-frontend packages are on CD 1, while the xsane and xsane-gimp packages are on CD...

Managing xinetd services

There are a bunch of services, particularly Internet services, that are not handled by separate run-level scripts. Instead, a single run-level script called xinetd (formerly inetd) is run to handle incoming requests for these services. For that reason, xinetd is sometimes referred to as the super-server. The xinetd runlevel script (along with the xinetd daemon that it runs) offers the following advantages Fewer daemon processes. Instead of one (or more) daemon processes running on your computer...

Creating the kickstart file

A good way to begin creating your kickstart file is from a sample ks.cfg file. When you install Red Hat Linux, the installation process places a file called anaconda-ks.cfg into the root directory. You can use this file as the basss for the ks.cfg file that you will use for your kickstart installs. The particular root anaconda-ks.cfg file you get is based on the information you entered during a regular installation (CD, NFS, and so on). Presumably, if you are installing Red Hat Linux on other...

Running DOS applications

Because Linux was originally developed on PCs, a variety of tools were developed to help developers and users bridge the gap between Linux and DOS systems. A set of Linux utilities called mtools lets you work with DOS files and directories within Linux. A DOS emulator called dosemu lets you run DOS applications within a DOS environment that is actually running in Linux (much the way a DOS window runs within a Windows operating system). Mtools are mostly DOS commands that have the letter m in...

Checkng your PPP connection

To debug your PPP connection or simply to better understand how it works, you can run through the steps below. They will help you understand where information is being stored and how tools can be used to track this information. Checking that your modem was detected It is possible that your modem is not supported under Linux. If that is the case, your PPP connection might be failing because the modem was not detected at all. To scan your serial ports to see where your modem might be, type the...

Using Star Office

The StarOffice suite from Sun Microsystems Inc. (www.sun.com staroffice) is a product that runs on Linux, UNIX, and Windows operating systems. Like OpenOffice, StarOffice contains many features that make it compatible with Microsoft Office applications. In particular, it includes the capability to import Microsoft Word and Excel files. There is also strong support for producing HTML files. StarOffice is probably the most complete integrated office suite for Linux. It includes StarWriter This is...

Using Webbased CUPS administration

Although the preferred way to configure CUPS printing in Red Hat Linux is with the Printer configuration window, CUPS offers its own Web-based administrative tool. CUPS listens on port 631 to provide access to the CUPS Web-based administrative interface. On the local computer, type the following into your Web browser's location box You will be prompted for a valid login name and password. Type the root login name and the root user's password. A screen similar to the one shown in Figure 17-2...

Configuring a simple firewall

You want your computer to be safe from network intruders, but you may not aspire to be a firewall expert. Instead of trying to understand all the ins and outs of iptables or ipchains, Red Hat Linux offers the Configure Firewalling window (also refers to as Lokkit). With Configure Firewalling, you don't need to know how to load rules or memorize port numbers. All you need to do is choose what types of services you want your computer to allow in and out over your network connections. It...

Administrative configuration files

Configuration files are another mainstay of Linux administration. Almost everything you set up for your particular computer user accounts, network addresses, or GUI preferences is stored in plain-text files. This has some advantages and some disadvantages. The advantage of plain-text files is that it is easy to read and change them. Any text editor will do. On the downside, however, is that as you edit configuration files, no error checking is going on. You have to run the program that reads...

Understanding Wildmat Characters

When you need to identify newsgroups in your newsfeeds configuration file, you can use several different wildcard characters to simplify the process. These characters are defined on the wildmat man page (type man wildmat). Here's what they do The exclamation point is used to indicate that the newsgroup name that follows should not be matched. * An asterisk at the end of a newsgroup name indicates that all newsgroups following the one shown (those lower in the hierarchy) should be matched. abc...

Database services

Database servers provide tools for accessing and managing databases of information. The Postgresql service uses the postmaster daemon to handle requests for its services. The MySQL server runs the mysqld daemon to handle access to its databases. These daemons are started from start-up scripts in etc init.d postgresql and mysqld scripts, respectively. Cross-Reference Chapter 24 describes how to set up a MySQL database server. User services Red Hat Linux can provide end users with a variety of...

The xinetd superserver

The xinetd daemon is referred to as the super-server. It listens for incoming requests for services based on information in separate files in the etc xinetd.d directory. When a request for a service is received by the xinetd daemon (for a particular network port number), xinetd typically launches a different daemon to handle the request. So instead of having separate daemons running for every network service, only the xinetd daemon needs to run plus an additional daemon process for each service...

Using the Washington University FTP Server WUFTPD

Although WU-FTPD was dropped from the distribution, you can still use WU-FTPD by downloading and installing the following packages from rpmfind.net When WU-FTPD is first installed, it is disabled. However, much of the FTP configuration is already in place. Note Refer to Starting and shutting down the WU-FTPD service to see how to start the FTP server. The following sections describe the setup of the wu-ftpd package when it is first installed FTP Daemon The FTP daemon is set up in the etc...

Configuring remote printers

To use a printer that is available on your network, you must identify that printer to your Red Hat Linux system. Supported remote printer connections include Networked CUPS (IPP) printers, Networked UNIX (LPD) printers, Networked Windows (SMB) printers, NetWare printers and JetDirect printers. (Of course, both CUPS and UNIX print servers can be run from Linux systems, as well as other UNIX systems.) In each case, you need a network connection from your Red Hat Linux system that enables you to...

Setting Up an NFS File Server in Red Hat Linux

Instead of representing storage devices as drive letters (A, B, C, and so on), as they are in Microsoft operating systems, Red Hat Linux connects file systems from multiple hard disks, floppy disks, CD-ROMs, and other local devices invisibly to form a single Linux file system. The Network File System (NFS) facility lets you extend your Red Hat Linux file system in the same way, to connect file systems on other computers to your local directory structure as well. Cross-Reference See Chapter 1O...

Configuring a simple Samba server

The Samba Server Configuration window lets you do some basic Samba configuration and then identify which directories you want to share. To make this procedure useful, I'm setting up a particular type of shared environment (which you can modify later if you prefer). Here are the characteristics A single local area network Contains multiple Windows and Linux machines. User level security Any user who wants to get to the shared Samba files must have a valid login and password on the Red Hat Linux...

Setting up dialup PPP

Point-to-Point Protocol (PPP) is used to create Internet Protocol (IP) connections over serial lines. Most often, the serial connection is established over a modem however, it will also work over serial cables (null modem cables) or digital lines (including ISDN and DSL media). Although one side must dial out while the other side must receive the call to create a PPP connection over a modem, after the connection is established, information can flow in both directions. For the sake of clarity,...

Using Open Office

Some have called OpenOffice a significant threat to Microsoft's dominance of the desktop market. If a need to work with documents in Microsoft Word format has kept you from using Linux as your desktop computer, OpenOffice is a big step toward removing that obstacle. Note If you are willing to pay a few dollars, CrossOver Office from Codeweavers.com lets you install and run older versions of Microsoft Office 97, 2000, XP, and so on from your Linux desktop. See Chapter 5 for further information...

Choosing Different Install Modes

Although most computers will enable you to install Red Hat Linux in the default mode (graphical), there may be times when your video card does not support that mode. Also, though the install process will detect most computer hardware, there may be times when your hard disk, Ethernet card, or other critical piece of hardware cannot be detected and will require you to enter special information at boot time. The following is a list of different installation modes you can use to start the Red Hat...

Checking for the shadow password file

The password file is named passwd and can be found in the etc directory. The shadow password file is named shadow and is also located in etc. If your etc shadow file is missing, then it is likely that your Linux system is storing the password information in the etc passwd file instead. Verify this by displaying the file with the less command. Something similar to the following should be displayed root DkkS6Uke7 9 9fQ 0 0 root root bin bash bin * 1 1 bin bin daemon * 2 2 daemon sbin mary...

Format of the inittab file

The plain-text inittab file consists of several colon-separated fields in the format The id field is a unique identifier, one to four alphanumeric characters in length that represents a particular action to take during system start-up. The runlevels field contains a list of run levels in which the command will be run. Common run levels are 0, 1, 2, 3, 4, 5, and 6 (s and S represent single-user mode, which is equivalent to 1). Run levels 7, 8, and 9 can also be used as the special run levels...

The TUX Web server

The TUX Web server (also referred to as the Red Hat Content Accelerator) is a high-performance, kernel-based Web server that is part of the Red Hat Linux distribution. By operating within the Linux kernel, TUX can very efficiently serve static content (such as images) while integrating with another Web server' daemon to handle content that is not yet supported in TUX' kernel drivers (such as various scripting languages that TUX doesn't know about). On a computer where it is being used, the TUX...

Booting your computer with GRUB

With multiple operating systems installed and several partitions set up, how does your computer know which operating system to start To select and manage which partition is booted and how it is booted, you need a boot loader. The boot loader that is installed by default with Red Hat Linux is called the GRand Unified Boot loader (GRUB). GRUB is a GNU software package (www.gnu.org software grub) that replaced the LILO boot loader by default in Red Hat Linux 7.2. GRUB offers the following features...

Using a Digital Camera with gtkam and gphoto2

With the gtkam window, you can download and work with images from digital cameras. The gtkam window is front end to gPhoto2, which provides support for dozens of digital cameras in Linux. The gtkam window works by attaching a supported digital camera to a serial or USB port on your computer. You can view thumbnails of the digital images from the camera, view full-size images, and download the ones you select from the camera to your hard disk. Note If you have a camera that saves images to a...

Configuring a shared Samba printer

Your Red Hat Linux printers can be configured as shared SMB printers. To share your printer as though it were a Samba (SMB) printer, all you need to do is configure basic Samba server settings as described in Chapter 18. All your printers should be shared on your local network by default. The next section shows what the resulting settings look like and how you might want to change them. When you configure Samba, as described in Chapter 18, the etc samba smb.conf file is configured to allow all...

Removing print jobs with lprm

Users can remove their own printjobs from the queue with the lprm command. Used alone on the command line, lprm removes all the user's printjobs from the default printer. To removejobs from a specific printer, use the -P option, as follows To remove all printjobs for the current user, type the following lprm - The root user can remove all the printjobs for a specific user by indicating that user on the lprm command line. For example, to remove all printjobs for the user named mike, the root...

Booting your computer with LILO

Like other boot loaders, LILO is a program that can stand outsde the operating systems installed on the computer so you can choose which system to boot. It also lets you give special options that modify how the operating system is booted. Note LILO is not part of the Fedora Core vera on of Red Hat Linux, so it is not available on the CDs that come with this book. However, LILO is still available from Red Hat FTP sites with older veraons of Red Hat Linux and with...

Writing to CDs

Because the data written to a CD becomes permanent once it is written, you need to format the CD and copy files to it all in one step. If you formatted it first, you would end up with an empty file system on a CD that can no longer be written to. The first step is to create an image of the CD file system as a file on your computer. You do this with the mkisofs command. As an example, imagine that you want to back up the home directory for user mary. You would invoke the mkisofs command and pass...

Detecting Intrusions from Log Files

Preparing your system for a cracker attack is only part of the battle. You must also recognize a cracker attack when it is occurring. Understanding the various log files in which Red Hat Linux records important events is critical to this goal. The log files for your Red Hat Linux system can be found in the var log directory. Red Hat Linux comes with a System Logs window (redhat-logview command) that you can use to view and search critical system log files from the GUI. To open the System Logs...

Quick Starting the Apache Web Server

If Apache wasn't installed during Red Hat installation, you can install it later from the CD-ROMs that come with this book. You will need the httpd package and optionally the httpd-manual package (named apache and apache-manual in earlier versions). Note It is possible for a new version of Apache to be released before an equivalent Red Hat package is available. Or perhaps you'd prefer to customize the server' compile-time options and build Apache directly from the source code. Download the full...

Watching TV with Xawtv

The Xawtv program lets you display video output, in particular television channels, on your desktop. You can change the channels, adjust volume, and fine-tune your picture. Added features let you grab still images in PBM or JPEG formats, or capture video clips in AVI. The Xawtv will display, by default, any device producing video on the dev video0 device. Therefore, you can use Xawtv to view Webcams as well as receive television channels. The following sections describe how to choose a TV...

Using Adobe Acrobat Reader

The Portable Document Format (PDF) provides a way of storing documents as they would appear in print. With Adobe Acrobat Reader, you can view PDF files in a very friendly way. Adobe Acrobat makes it easy to move around within a PDF file. A PDF file may include hyperlinks, a table of contents, graphics, and a variety of type fonts. A recent version of the Adobe Acrobat Reader (version 5.06) is available in RPM format from Guru Labs (www.gurulabs.com downloads.html). This version can use many PDF...

Myth II Soulblighter

If you like knights and dwarves and storming castles, Myth II Soulblighter for Linux might be for you. In Myth II, you are given a mission and some troops with various skills. From there, you need strategy and the desire to shed lots of virtual blood to meet your goal. Myth II was created by Bungie Software (www.bungie.com) and ported to Linux by Loki Entertainment Software (www.lokigames.com). This version of the popular Myth game includes improved graphics and new scenarios. A demo version is...

Using textbased Web browsers

If you become a Linux administrator or power user, over time you will inevitably find yourself working on a computer from a remote login or where there is no desktop GUI available. At some point while you are in that state, you will probably want to check an HTML file or a Web page. To solve the problem, Red Hat Linux includes several text-based Web browsers. With text-based Web browsers, any HTML file available from the Web, your local file system, or a computer where you're remotely logged in...

Using Apple Talk netatalk from Mac OS X

AppleTalk is the traditional set of protocols used by Apple computers to share files and printers over a LAN. Although Mac OS X can support Samba file sharing, AppleTalk is still a familiar way for Mac users to get to networked printers and files Inside Red Hat Linux is a software package called netatalk that can be used to configure Red Hat Linux as an AppleTalk file and printer server. To a Mac client, the netatalk server looks no different than any other AppleTalk server. Cross-Reference...

Introduction to Web Servers

The World Wide Web, as it is known today, began as a project of Tim Berners-Lee at the European Center for Particle Physics (CERN). The original goal was to provide one consistent interface for geographically dispersed researchers and scientists who needed access to information in a variety of formats. From this idea came the concept of using one client (the Web browser) to access data (text, images, sounds, video, and binary files) from several types of servers (HTTP, FTP, SMTP, Gopher, NNTP,...

Configuring the Web server httpdconf

The httpd.conf file is the primary configuration file for the Apache Web server. It contains options that pertain to the general operation of the server. The default filename ( etc httpd conf httpd.conf) can be overridden by the -f filename command-line argument to the httpd daemon or the ServerConfigFile directive. The following sections list the contents of the httpd.conf file and describe how to use the file. The first section contains comments about the httpd.conf file Based on the NCSA...

Analyzing Webserver traffic

The webalizer command can take Apache log files and produce usage reports for your server. Those reports are created in HTML format so you can display the information graphically. Information is produced in both table and graph form. To use the webalizer command, the webalizer package must be installed. You can run webalizer with no options and have it take the values in the etc webalizer.conf files to get the information it needs. As an alternative, you can use command-line options to override...

Listening to Audio

If you want the sound on your computer to be more than the speaker on your PC going bing occasionally, you must have a separate sound card or one built into your computer's motherboard. Games are a reason to add a sound card, if the games rely on sound effects or other audio cues. Also, sound cards let you play music and communicate on the Internet using a variety of communications tools. To give you an idea of the features that a sound card can provide, the following lists features that are...

Getting a list of active newsgroups

The Internet Software Consortium (www.isc.org) maintains a listing of all officially active newsgroups. ISC stores these newsgroups in two files newsgroups and active. The newsgroups file contains each newsgroup name and a short description of each. The active file stores the newsgroups to indicate which newsgroups your news server offers. There are two ways you can go about creating your newsgroups and active files. For a minimal news server, you can use the default newsgroups and active files...

Sharing NFS file systems

To share an NFS file system from your Red Hat Linux system, you need to export it. Exporting is done in Red Hat Linux by adding entries into the etc exports file. Each entry identifies the directory in your local file system that you want to share. The entry identifies the other computers that can share the resource (or opens it to all computers) and includes other options that reflect permissions associated with the directory. Remember that when you share a directory, you are sharing all files...

Activating the wireless interfaces

To immediately activate the wireless interface you just configured, click on the Wireless entry on the Network Configuration window and click the Activate button. After a few seconds, the Status should appear as Active. To have the interface start when you reboot your computer, click the wireless interface from the Network Configuration window and select Edit. From the Wireless Device Configuration window that appears, click the box next to Activate device when computer starts. If you want to...

Using the pax Archiving Tool

Over the years, a variety of UNIX operating systems have arisen, resulting in a variety of similar but incompatible file archiving formats. Even tools that go by the same name may use slightly different storage formats on different systems. This can lead to big problems when trying to archive and retrieve data in a multiplatform environment. Fortunately, there is a solution. The pax program is a POSIX standard utility that can read and write a wide variety of archive formats. An RPM package for...

Upgrading packages with rpm

The upgrade option (-U) with rpm can, as you might expect, al so be used to upgrade existing packages. The format is the same as described above Tip Although there is a separate instal l option (-i), I recommend using the -U option whether you are doing a new instal l or an upgrade. With -U, the package instal l s in either case. So rpm -U always works, whil e rpm -i fails if the package is al ready instal l ed. One issue when upgrading is instal l ing an ol der version of a package. For exampl...

Commandline editing

If you type something wrong on a command line, the bash shell ensures that you don't have to delete the entire line and start over. Likewise, you can recall a previous command line and change the elements to make a new command. By default, the bash shell uses command-line editing that is based on the emacs text editor. So, if you are familiar with emacs, you probably already know most of the keystrokes described here. Tip If you prefer the vi command for editing shell command lines, you can...

Reclaiming disk space from existing partitions

Chances are that your PC came with a Windows operating system already installed on the entire disk. Installing Red Hat while keeping Windows on your hard disk presents a problem. Red Hat Linux and Windows operating systems are put on separate disk partitions, and right now there is only one partition (and it isn't for Red Hat Linux). If you are in this predicament, but you have a lot of unused space in your Windows partition (at least 1GB or more), follow this procedure to reclaim the disk...

Insert the floppy boot disk

You should see the Welcome to Red Hat boot screen. 3. Press Enter. You are prompted to select a language. 4. Select the language. You are prompted to choose a keyboard type. 5. Select your keyboard type. You are prompted to select an installation method. 6. Choose the installation method. Select any of the following installation methods NFS image, FTP, HTTP, or Hard drive. 7. Configure the network card. For any of the network installs, you are asked to select your Ethernet...