Official Red Hat Linux Administrators Guide

Printer configuration has long been a headache for Linux and UNIX administrators. Red Hat Linux provides the Printer Configuration Tool for streamlining the task of configuring LPRng, the default printing system. As an alternative to LPRng, Red Hat Linux also includes the Common Unix Printing System (CUPS), which can be configured through a Web interface.

The Printer Configuration Tool allows users to configure a printer in Red Hat Linux. It helps maintain the /etc/printcap configuration file, print spool directories, and print filters. Starting with version 8.0, Red Hat Linux ships with two printer systems. The Printer Configuration Tool configures the printing system called LPRng. LPRng is also the default printing system. This chapter focuses on using the Printer Configuration Tool to configure LPRng. For more information on the alternate printing system called CUPS, refer to the “Configuring CUPS” section of this chapter.

To use the Printer Configuration Tool, you must have root privileges. To start the application, select Main Menu Button (on the Panel) > System Settings > Printing, or type redhat-config-printer. This command automatically determines whether to run the graphical or text-based version. You can also force the Printer Configuration Tool to run as a text-based application by using the command redhat-config-printer-tui from a shell prompt. To add a printer using the command-line version, refer to the “Command-Line Configuration” section of this chapter.

Warning

Do not edit the /etc/printcap file. Each time the printer daemon (lpd) is started or restarted, a new /etc/printcap file is dynamically created.

If you want to add a printer without using the Printer Configuration Tool, edit the /etc/printcap.local file. The entries in /etc/printcap.local are not displayed in the Printer Configuration Tool but are read by the printer daemon. If you upgrade your system from a previous version of Red Hat Linux, your existing configuration file is converted to the new format used by this application. Each time a new configuration file is generated, the old file is saved as /etc/printcap.old.

Figure 8-1: The Printer Configuration Tool

Five types of print queues can be configured:

Clicking the Apply button saves any changes that you have made and restarts the printer daemon. The changes are not written to the /etc/printcap configuration file until the printer daemon (lpd) is restarted. Alternatively, you can choose File > Save Changes and then choose File > Restart lpd to save your changes and then restart the printer daemon.

If a printer appears in the main printer list with the Queue Type set to INVALID, the Printer Configuration Tool is missing options that are required for the printer to function properly. To remove this printer from the list, select it from the list and click the Delete button.

Adding a Local Printer

To add a local printer such as one attached to the parallel or USB port of your computer, click the New button in the main Printer Configuration Tool window. The window shown in Figure 8-2 will appear. Click Next to proceed.

Figure 8-2: Adding a printer

You will then see the screen shown in Figure 8-3. Enter a unique name for the printer in the Queue Name text field. This can be any descriptive name for your printer. The printer name cannot contain spaces and must begin with a letter a through z or A through Z. The valid characters are a through z, A through Z, 0 through 9, -, and _ (underscore). Select Local Printer from the Queue Type menu and click Next.

The Printer Configuration Tool attempts to detect your printer device and model as shown in Figure 8-4. If your printer device is not shown, click Custom Device. Type the name of your printer device and click OK to add it to the printer device list. A printer device attached to the parallel port is usually referred to as /dev/lp0. A printer device attached to the USB port is usually referred to as /dev/usblp0. If your printer model does not appear, you will be given the opportunity to select it in the next step. Click Next to continue.

Figure 8-3: Adding a local printer

Figure 8-4: Local printer device

If the Printer Configuration Tool detects your printer model, it displays the recommended print driver. Skip to the section “Selecting the Print Driver and Finishing” to continue.

Adding a Remote UNIX Printer

To add a remote UNIX printer, such as one attached to a different Linux system on the same network, click the New button in the main Printer Configuration Tool window. The window shown in Figure 8-2 will appear. Click Next to proceed.

You will then see the screen shown in Figure 8-5. Enter a unique name for the printer in the Queue Name text field. The printer name cannot contain spaces and must begin with a letter a through z or A through Z. The valid characters are a through z, A through Z, 0 through 9, -, and _ (underscore). Select Unix Printer from the Queue Type menu and click Next.

Text fields for the following options appear as shown in Figure 8-6:

Click Next to continue.

Figure 8-5: Adding a remote printer

The next step is to select the type of printer that is connected to the remote system. Skip to the section “Selecting the Print Driver and Finishing” to continue.

Figure 8-6: Choosing the printer server

Note

The remote machine must be configured to allow the local machine to print on the desired queue. As root, create the file /etc/hosts.lpd on the remote machine to which the printer is attached. On separate lines in the file, add the IP address or hostname of each machine that should have printing privileges.

Adding a Samba (SMB) Printer

To add a printer that is accessed using the SMB protocol (such as a printer attached to a Microsoft Windows system), click the New button in the main Printer Configuration Tool window. The window shown in Figure 8-2 will appear. Click Next to proceed.

You will see the screen shown in Figure 8-7. Enter a unique name for the printer in the Queue Name text field. The printer name cannot contain spaces and must begin with a letter a through z or A through Z. The valid characters are a through z, A through Z, 0 through 9, -, and _ (underscore). Select Windows Printer from the Queue Type menu and click Next. If the printer is attached to a Microsoft Windows system, choose this queue type.

Figure 8-7: Adding an SMB printer

Text fields for the following options appear as shown in Figure 8-8:

Click the Translate \n => \r\n button to translate the end-of-line characters to a form that is readable by a Microsoft Windows system. Click Next to continue.

The next step is to select the type of printer that is connected to the remote SMB system. Skip to the section “Selecting the Print Driver and Finishing” to continue.

Figure 8-8: Choosing the print server

Note

If you require a username and password for an SMB (LAN Manager) print queue, they are stored unencrypted in the spool directory, which only root or lp may read. Thus, it is possible for others to learn the username and password if they have root access. To avoid this, the username and password to access the printer should be different from the username and password used for the user’s account on the local Red Hat Linux system. If they are different, then the only possible security compromise would be unauthorized use of the printer. If there are file shares from the SMB server, it is recommended that they also use a different password from the one for the print queue.

Adding a Novell NetWare (NCP) Printer

To add a Novell NetWare (NCP) printer, click the New button in the main Printer Configuration Tool window. The window shown in Figure 8-2 will appear. Click Next to proceed.

You will see the screen shown in Figure 8-9. Enter a unique name for the printer in the Queue Name text field. The printer name cannot contain spaces and must begin with a letter a through z or A through Z. The valid characters are a through z, A through Z, 0 through 9, -, and _ (underscore). Select Novell Printer from the Queue Type menu and click Next.

Text fields for the following options appear below the Queue Type menu as shown in Figure 8-10:

The next step is to select the type of printer that is connected to the remote NCP system. Skip to the section “Selecting the Print Driver and Finishing” to continue.

Note

If you require a username and password for a NCP (NetWare) print queue, they are stored. Thus, it is possible for another person to learn the username and password. To avoid this, the username and password to use the printer should be different from the username and password used for the user’s account on the local Red Hat Linux system. If they are different, then the only possible security compromise would be unauthorized use of the printer.

Adding a JetDirect Printer

To add a JetDirect printer, click the New button in the main Printer Configuration Tool window. The window shown in Figure 8-2 will appear. Click Next to proceed.

You will see the screen shown in Figure 8-11. Enter a unique name for the printer in the Queue Name text field. The printer name cannot contain spaces and must begin with a letter a through z or A through Z. The valid characters are a through z, A through Z, 0 through 9, -, and _ (underscore). Select JetDirect Printer from the Queue Type menu and click Next.

Figure 8-11: Adding a JetDirect printer

Text fields for the following options appear below the Queue Type menu as shown in Figure 8-12:

The next step is to select the type of printer that is connected to the JetDirect system. Skip to the section “Selecting the Print Driver and Finishing” to continue.

Категории