Use Samba for cross-platform Printing

Source: Internet
Author: User

If you are working on a cross-operating platform network, the network may include Windows, Linux, and UNIX workstations, servers, then you must be interested in how to implement the network printing service on these different platforms.

Last week, I introduced how to implement the network printing service on Linux. In this section, you will learn how to implement this service for Windows 95/98/NT/2000 users. By modifying the Samba configuration on your server, you can allow Windows users on the network to share your local printer.

Note that we assume that you have successfully installed and configured Samba file sharing between Linux and Windows. If you have not installed and configured Samba, or your Samba cannot work properly, read the article "Save Money: Replace the NT Server with Samba in Linux ". To achieve our goal, I also assume that you have successfully installed a local printer.

Configure Samba for local printer sharing

Make sure that your Samba runs normally before you start, and Windows users can see the Samba server in the list of network neighbors. I will introduce how to modify the smb. conf file so that Windows users in the network can use the printer through the Samba server.

To configure the smb. conf file to share a local printer, check whether the printer in Linux works properly. Next, install the same printer on the Windows client. In this case, you need an installation disk for the printer in Windows. Start to install the printer, click Start, select the printer, and double-click to add the printer.

In the printer Installation Wizard, follow the instructions on the screen to select the name of the printer in the list. Key Point: Write the accurate name of the printer. Note that the name is case sensitive ). For example, the Epson Stylus 740 printer used in Windows should be input and restarted after installation. Log on to the Samba server as the root user or as a Super User) and open/etc/smb. conf or/etc/samba/smb. conf in the text editor you are used. For example, vi/etc/smb. conf.

In the [global] section, find the Print name line. If you want Windows users to use all local printers, remove this line, and if the file does not contain this line, add:

Printcap name =/etc/printcap

Load printers = yes

If you only want other users to use a printer, do not delete the line or add anything. Note that on most Linux systems developed from BSD, Samba assumes that you are using the default printing system. If you are using another printing system, in the Linux printing system configuration, find the corresponding line and change the default bsd ). Select sysv, plp, lprng, aix, hpux, and qnx. If you cannot confirm the printing system in use for your Linux configuration, you can check the relevant files, but most of the time it is the default.

Next, share all local printers. All the printers are in the printer list of the/etc/printcap file. Add the following service entries at the end of the/etc/smb. conf file:

[Printers]

Writable = no

Path =/tmp

Printable = yes

If you only need to share a printer, add an automatic service line in the [global] section of the smb. conf file. Same as in/etc/printcap, this line specifies the name of the printer you want to use. Enter the name of the default printer in the lp Field:

Auto services = lp

In addition, create a printer definition, and add it to the end of the/etc/smb. conf file in the [services] section ):

[Lp]

Printable = yes

Comment = Epson Stylus Color)

Public = yes

Writable = no

Browseable = yes

Printer driver = EPSON Stylus COLOR 740

The printer name in the definition is lp, which must be the same as the name in the above automatic service line, the name must also be the same as the printer name defined in the/etc/printcap file or the printer alias ). Note that the printer driver line requires you to correctly enter the printer information in Windows here, EPSON Stylus COLOR 740, or pay attention to the case ).

Finally, save the/etc/smb. conf file. Exit the text compiler and type/etc/init. d/rc. d/smb to restart Samba.

Detect Installation

Check your installation results on one of the Windows workstations

. Log on with your Windows Network username and password. Double-click the network neighbor and double-click the Linux icon to check whether the Samba printer is displayed. If you right-click and select install, you can see the printer installation dialog box. At the beginning of installation, users do not need to care about the brand and model of the printer, because the name of the printer is defined in a way that is recognized by Windows. However, you still need to install the printer disk. If Windows originally supports this printer, you only need to install the disk for Windows.

Printer drive Positioning

Printer drive positioning is a Samba option that allows you to specify the location of the printer driver software. Although you can select the appropriate printer drive and Related Files option in the shared Linux directory, this option does not work for many printer drives, in addition, you may have infringed the copyright of the author because you have not obtained a license to use the software on the Internet.

Samba print troubleshooting

If your printer works normally on Linux, but you cannot use Samba to implement the Print Service, log on to the printer with a Super User and use a text compiler to open/etc/smb. conf. Check your input carefully. Run testparm/etc/smb. conf and check the output result carefully to find the error mark. Be sure that/dev/null is writable to any user: Type ls-l/dev/null, press enter to view the file read permission ). Samba ignores unnecessary output through/dev/null. If this file is not writable to all users, Log On As a Super User, type chmod a + w/dev/null, and press Enter. If your printer only outputs code rather than the image you want, add postscript = yes to the printer definition in the/etc/samba. conf file.

Fee sharing

In this article, you learned how to modify Samba configurations so that printers connected to Linux systems can be used by Windows and Linux/UNIX hosts throughout the network. Implementing network services on different platforms means higher efficiency and less cost.

  1. Advanced applications of Samba server under Solaris
  2. Add a Windows Driver to a printer shared by samba
  3. Introduction to the installation of Samba servers in Fedora Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.