• Aucun résultat trouvé

System Configuration

Part II: Basic Setup

Chapter 4: System Configuration

Chapter 5: Network Configuration Chapter 6: Security Configuration

Chapter 7: Setting Up a Local Area Network with Red Hat

Chapter 4: System Configuration

Overview

To make effective use of your Linux system, you must know how to configure certain features. Administrative operations such as adding users, accessing CD-ROM drives, and installing software can now be performed with user-friendly system tools. This chapter discusses basic system administration operations that you need to get your system up and running, as well as to perform basic maintenance such as adding new users or printers.

There are three basic system configuration tasks that you most likely will have to deal with:

user management, file system access, and printer setup. You can manage users, adding new ones and removing others. File systems such as floppy disks, CD-ROMs, or other hard drives can be attached to your system at specific directories. You can also add different kinds of printers. All of these tasks you were asked to perform during installation. You can make changes or additions easily using the administration tools described in this chapter.

When logged in as the root user, you can also perform certain configuration operations from the command line. You can manually access system configuration files, editing them and making entries yourself. For example, the domain name server entries are kept in the /etc/resolv.conf file. You can edit this file and type in the addresses.

Note Configuration tools are only accessible by the root user. You will first need to log in using root as your user name and providing the root password you specified during installation.

Configuration operations can be performed either from a GUI interface such as Gnome or KDE, or they can be performed using a simple shell command line at which you type in configuration commands. Red Hat also provides a set of cursor-based configuration tools, referred to as the Text Mode Setup Utility, which can be run from any shell command line.

These tools cover a variety of tasks such as mouse, network, and X Windows System configuration (network configuration is covered in Chapter 5), and are shown in Table 4-1.

GUI Administration Utilities: Linuxconf and Webmin

On Red Hat, the primary administrative tools are a set of specialized GUI-based

administrative tools developed and supported by Red Hat such as for network configuration and the Red Hat PPP Dialer for modem configuration. In addition, you can also use third-party GUI administrative tools such as Linuxconf and Webmin. Both provide comprehensive administration support covering tasks from users and group management to file systems and server configuration. Linuxconf was used as the primary administrative tool in Red Hat releases 6.0-7.0, and is still included with Red Hat 7.1. A full installation of Red Hat Linux 7.1 will install Linuxconf, but a standard installation will not. If you performed a standard installation, you will have to manually install Linuxconf yourself. You can also download Linuxconf or Webmin from their Web sites , as listed in Table 4-1. Commercial

administration tools are also available such as Volution from Caldera.

Table 4-1: Red Hat Configuration Tools Red Hat Administration Tool Description or Site

Linuxconf www.solucorp.qc.ca./linuxconf

Table 4-1: Red Hat Configuration Tools Red Hat Administration Tool Description or Site

Webmin www.webmin.com

printconf Printer configuration tool

setuptool Text Mode Setup Utility, cursor-based

configuration tool

TimeTool Tool to set the system time and date

Linuxconf

Linuxconf provides an extensive set of configuration options, enabling you to configure features, such as user accounts and file systems, as well as your Internet servers, dial-up connections, and LILO. The version included with Red Hat does not provide support for servers. You can access the main Linuxconf interface with its entire set of configuration options or use specialized commands that display entries for a particular task, such as configuring user's accounts or entering your network settings. The specialized commands include userconf for user accounts, fsconf for file systems, and netconf for networks. In all cases, you need to log in as the root user.

Linuxconf supports three interfaces: an X Window System interface, a cursor-based interface, and a Web interface. The X Window System interface runs under Gnome using gnome-linuxconf to provide Gnome desktop features. You can use the cursor-based interface from a Linux command line, and you needn't be running a GUI. The interface presents a full-screen display on which you can use arrow keys, the TAB key, the SPacebar, and the ENTER key to make selections. With the Web-based interface, you use your Web browser to make selections (though this is meant for use on local networks). Use the URL for your system with a :98 attached, as in turtle.mytrek.com:98.

Tip The Gnome interface for Linuxconf is installed by a separate package called the gnome-linuxconf package. Be sure this is installed to use Linuxconf on Gnome.

Webmin

Webmin is a Web page-based interface that you can run on any Web browser by accessing port 10000 at localhost http://localhost:10000. The initial Webmin page, shown in Figure 4-1, will have panels for different kinds of configuration tasks such as system, hardware, and servers. For basic administration tasks, click the System panel to show icons for different system administration tasks such as managing users and mounting file systems. With Webmin, you can perform all the tasks that the Red Hat tools perform.

Figure 4-1: Webmin for Red Hat

For example, on Webmin you can manage users with the Users and Groups page selected from the System page. Here you can add new users, entering their user names and passwords.

Current users are listed each with the user name as a link you can use to display a page for editing a user's account.

Configuring Users

Currently, the easiest and most effective way to add new users on Red Hat is to use the Red Hat User Manager. You can access it from the Gnome Desktop's Start Here window's System-Settings window. The User Manger window will display panels for listing both users and groups (see Figure 4-2). A button bar will list various tasks you can perform, including creating new users or groups, editing current ones (Properties), or deleting a selected user or group.

Figure 4-2: Linuxconf user account configuration

To create a new user, click on the New button. This opens a window with entries for the user name, password, login shell, along with options to create a home directory and a new group for that user. Once you have created a user, you can edit its properties to add or change features. Select the user's entry and click the Properties button. This displays a window with tabbed panels for User Data, Account Info, Password Info, and Groups. On the Groups panel, you can select the groups that the user belongs to, adding or removing group membership.

Alternatively you can use the useradd command to add user accounts and the userdel command to remove them. The following example adds the user dylan to the system:

$ useradd dylan

One common operation performed from the command line is to change a password. Any user can change his or her own password with the passwd command. The command prompts you for your current password. After entering your current password and pressing ENTER, you are then prompted for your new password. After entering the new password, you are asked to reenter it. This is to make sure you actually entered the password you intended to enter.

Because password characters are not displayed when you type them, it is easy to make a mistake and to press a wrong key.

$ passwd Old password:

New password:

Retype new password:

$

Tip From the Gnome interface you can also use the Password tool on the System menu to change your password.

Managing File Systems and CD-ROMs

Files and directories contained on different hardware devices such as floppy disks, CD-ROMs, and hard disk partitions are called file systems. The Linux partition you used to install your Linux system on is called the root partition. This is where you mounted the root file system, the root directory indicated with a single slash, /.The root partition contains the main file system with a directory tree, starting from the root and spreading out to different system and user subdirectories. To access files on another file system-say, a CD-ROM disc-you need to attach that file system to your main system. Attaching a file system is called mounting the file system. You first set up an empty directory to which you want to mount the file system.

Note On Red Hat, the /mnt/cdrom directory is already reserved for mounting CD-ROMs, and the /mnt/floppy directory is reserved for floppy disks. If you have more than one CD-ROM, numbered directories will be added, for example, /mnt/cdrom1 for the second CD-ROM.

Managing CD-ROMs

The Red Hat Gnome interface also provides a simple method for mounting and unmounting a CD-ROM. Simply insert the CD-ROM into your CD-ROM drive; you then see an icon labeled CD-ROM appear on the Gnome desktop. A CD-ROM is automatically mounted. A Gnome file manager window also automatically appears, which displays the contents of the ROM. You can also mount and unmount the ROM using a pop-up menu on the CD-ROM icon. Right-click it to display a pop-up menu with options to mount and unmount the CD-ROM along with other options (see Figure 4-3). Selecting Unmount Volume at the bottom of the pop-up menu will automatically unmount and eject the CD-ROM from your drive. You can access the ROM you placed in your CD drive by double-clicking the CD-ROM icon. Your CD-CD-ROM drive remains locked until you select the Unmount entry that is now displayed on the pop-up menu. If you do not see an icon for your CD-ROM, you must first make it user-mountable. Use fsconf or Linuxconf to select the local drive and double-click the CD-ROM entry in the Local volume window. Then, on the Options panel, select the user-mountable option. Click Act/Changes to register the change. Then right-click the desktop and select Rescan Desktop Shortcuts from the pop-up menu.

Figure 4-3: Gnome CD-ROM icon

You can also perform simple mount and unmount operations using the Disk Management tool accessible from the Gnome System menu. This tool will list all the file systems that can be mounted and will display buttons for mounting or unmounting them.

From any shell command line, you can also easily mount and unmount file systems with the mount and umount commands. To mount your CD-ROM, you only have to enter the

command mount and the directory /mnt/cdrom. You can then access the contents of the CD-ROM at the /mnt/cdrom directory.

$ mount /mnt/cdrom

When you finish, unmount the CD-ROM with the umount command.

$ umount /mnt/cdrom

Note You can also manually mount and unmount floppy disks and hard disk partitions. See Chapter 32 for a detailed discussion.

Installing IDE CD-R and CD-RW Disks

If your system has a CD write (CD-R) or read/write (CD-RW) drive that uses an IDE interface, it may have been detected during installation. To support CD-R and CD-RW IDE drives, a kernel module called ide-scsi has to be loaded. The installation process will detect your CD-R or CD-RW and configure your system to automatically load the ide-scsi module.

In that case your CD-R or CD-RW drive is ready to use. You can check to see if your CD-R or CD-RW drive was configured correctly by entering the following command. Information about your SCSI drives should be displayed.

cdrecord -scanbus

If configured correctly there should be an entry in your /etc/lilo.conf file for an append line that loads the module for your CD-R or CD-RW device. GRUB will add the argument to the command executed from its menu, which you can edit if you want.

append="hdc=ide-scsi"

Note SCSI CD-R and CD-RW drives will be automatically configured during the install process.

In this case, hdd is the device name for a CD-RW drive. There are four possible IDE devices on standard PCs, corresponding to the four primary and secondary master and slave IDE ports. The device name used in Linux depends on what IDE port you connected your CD-ROM or CD-R/CD-RW drives to. The primary master IDE port is hda and is usually used for an IDE hard drive. The other IDE ports are usually used for the CD drive. The primary slave IDE port is hdb, the secondary master is hdc (the most common connection), and the

secondary slave is hdd. The above example is for a CD-R or CD-RW drive connected to the secondary master IDE port (hdc).

Many systems will have both a CD-R or CD-RW drive and a regular CD-ROM drive. If you want to copy CD-ROMs directly from the CD-ROM drive to the CD-RW drive, then you need to configure the CD-ROM drive as a SCSI drive. In the following example, there is an IDE CD-ROM drive on the secondary slave port (hdd). The /etc/lilo.conf append line would have to be modified to include the hdd drive.

append="hdc=ide-scsi hdd=ide-scsi"

When you restart, your CD-R and CD-RW-as well as CD-ROMs-should be installed as SCSI drives and can be used by CD write software like cdrecord and KreateCD. See the "Installing Software Packages" section later in this chapter for how to download and install KreateCD.

If the cdrecord -scanbus command still does not display any SCSI drives, then your CD-R or CD-RW drive was not detected and the ide-scsi module was not loaded. In this case, the entries in the /etc/lilo.conf file would be missing. Your CD-RW and CD-R drives are working as simple CD-ROMs, with no CD read/write capabilities. You can try to add this line to your /etc/lilo.conf file and then re-execute LILO with the lilo command (entered at the prompt in a terminal window).

You can also manually specify the ide-scsi module as a kernel parameter when your system boots up. GRUB uses this method. At the boot: prompt, enter the following kernel parameter.

boot: linux hdc=ide-scsi

Enter as many CD drive entries as you need. For example, if you need to configure both the CD-ROM and the CD-RW, you could enter:

boot: linux hdx=ide-scsi hdd=ide-scsi

Your CD drives will be configured only until the system is shut down. The next time you boot up, you will have to enter the parameters again if you wish to do CD write tasks. Should this fail, you can manually install the ide-scsi module and change your CD drive device links, as described in Chapter 33.

Printer Configuration

As part of the installation procedure for Red Hat Linux, you configured a printer connected to your computer. To change configurations or to add a new printer later, you can use printconf.

You can access printconf on the Gnome System menu. The printconf utility enables you to select the appropriate driver for your printer, as well as to set print options such as paper size and print resolutions. You can use printconf to access a printer connected directly to your local computer or to a printer on a remote system on your network (see Chapter 33).

When you start up printconf, you are presented with a window that lists your installed printers (see Figure 4-4). To add a new printer, click the New button. To edit an installed printer, double-click its entry or select it and click the Edit button. Once you have made your changes, you can click on the Apply button to save your changes and restart the printer daemon. If you have more than one printer on your system, you can make one the default by selecting it and then clicking the Default button. The Delete button will remove a printer configuration.

Figure 4-4: printconf

When you select New, a series of dialogs will take you through the process of configuring a printer, starting with entering the printer name and choosing its type (see Figure 4-5). When

you edit a printer, a different dialog is displayed showing four tabbed panels: Name and Aliases, Queue Type, Driver, and Driver Options.

Figure 4-5: printconf printer name

On the Queue panel, entries are listed for printer devices with buttons at the bottom for scanning devices, manually setting up devices, and automatically detecting a device's driver.

The device is the port to which the printer is connected. For the first three parallel ports, these are lp0, lp1, lp2; for serial ports, these are ttyS0, ttyS1, and ttyS2; and so on (see Figure 4-6). From a drop-down menu, you can also specify whether the printer is local or remotely connected through a UNIX, Windows (SMB), or NetWare network.

Figure 4-6: printconf printer queues

For the driver selection you are presented with an expandable tree of printer types. You first select the manufacturer, such as Cannon or Apple, which then expands to a list of particular printer models (see Figure 4-7). Click yours.

Figure 4-7: printconf printer queues

For the options selection, you can specify printer features such as paper size and resolution.

Configuration Using Red Hat Setup

Red Hat also provides a Text Mode Setup Utility (setuptool) with which you can configure different devices and system settings, such as your keyboard, mouse, and time zone. The setuptool utility is useful if you have changed any of your devices-say, installed a new mouse, keyboard, or sound card. The setuptool utility is designed to be run from the command line interface. You start the utility with the command setup, which you enter at a shell command line. You can also select the Text Mode Tool menu on the Gnome System menu to run setuptool from within Gnome. The setuptool utility provides a full-screen, cursor-based interface where you can use arrow, TAB, and ENTER keys to make your selections. Initially, setuptool displays a menu of configuration tools from which you can choose. Use the arrow keys to select one, and then press the TAB key to move to the Run Tool and Quit buttons.

Figure 4-8 shows the initial Text Menu Setup Utility menu.

Figure 4-8: Red Hat Setup menu

The setuptool utility is actually an interface for running several configuration tools (see Table 4-2). You can call any of these tools separately using their commands. For example, the

The setuptool utility is actually an interface for running several configuration tools (see Table 4-2). You can call any of these tools separately using their commands. For example, the