Article Title: Use samba to share a network printer. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The company's printer is HP Laster Jet 1300n, with the HP jetdirect 200 m lio print server network interface, the printer IP address is 192.168.0.9, it is really troublesome to install and configure a change of print driver for each person, simply use samba to configure the printer to be shared.
I. Environment
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
IP Address: 192.168.0.5
The cups, samba, and hpijs packages installed by default are as follows:
Hal-cups-utils-0.5.2-8 Cups-libs-1.1.22-0.rc1.9.11 Cups-1.1.22-0.rc1.9.11 Libgnomecups-0.1.12-5
System-config-samba-1.2.21-1 Samba-common-3.0.10-1.4E.9 Samba-3.0.10-1.4E.9 Samba-client-3.0.10-1.4E.9
Hpijs-1.6-2 |
2. Configure the printer
First, start cups. The method is as follows:
#/Etc/init. d/cups start
Or
# Service cups start
Enter http: // 127.0.0.1: 631 in the browser of the local machine. The printer configuration page appears.
1. Click Administration and enter the root account and password correctly. The Admin page is displayed;
2. Click Add Printer. The Add New Printer page is displayed. Enter the following Printer information as needed and click continue;
Name: HP
Location: 192.168.0.9
Description: Share
3. The "Device for HP" page appears (HP is the name of the Printer you entered in the previous step). Set the Device type to "Windows Printer via SAMBA" and click "continue;
4. The "Device URI for HP" (same as above) page appears. Enter the following information for Device URI and click "continue;
Socket: // 192.168.0.9
5. On the "Model/Driver for HP" Page, select HP in Make (depending on your printer manufacturer) and click "continue;
6. On the "Model/Driver for HP" Page, select "HP LasterJet Series CUPS v1.1 (en)" in the Model (select your Model) and click "continue;
At this time, the printer has been added successfully. Click the Printers menu to check whether the printer has appeared. Click Print Teset Page. You can Print the Page. Then, OK ,:)
3. Configure the SAMBA server
Prerequisites: SAMBA is running normally (If you do not configure it, there are many online tutorials to find). Configure the following in the smb. conf file:
[Global] Printcap name =/etc/printcap Load printers = yes
Cups options = raw
[Printers] Comment = All Printers Path =/var/spool/samba Browseable = no Public = yes Printable = yes |
In fact, most of the configurations are the default ones. Use # service smb restart to restart the samba server.
4. Add a printer to the client
Windows xp is used for our work computers. In the "Start" menu, enter "// 192.168.0.5" in the "run" menu and press enter to open the shared directory. Go to the "printer and fax" directory and you will find the printer we added above. Select the printer and right-click "Connect". I am prompted that the printer driver is not correctly installed. If you want to search for a suitable driver, click "OK. Click "OK". A printer driver adding Wizard will appear. Select the correct printer manufacturer and model, and click "OK". The printer has been added.
You can open the file to be printed and select the printer we just added when printing. Alternatively, choose "start"> "Settings"> "printer and fax", right-click and select "set as default printer ". It will be convenient later.