Printers Share Section

The printers section performs a similar function to the homes section, which makes every home directory available to the appropriate user. The printers section is defined to make every printer available to your clients. The Red Hat printers share section is

[printers]

comment = All Printers path = /var/spool/samba browsable = no guest ok = no writable = no printable = yes

You know the comment, browsable, writable, and path options from Chapter 9. Here, however, path does not define the path of a shared file. Instead, it defines the path of the spool directory for the SMB shared printers. But which printers are shared? Based on the two options defined in the global section, all printers that are defined in the printcap file.

There are two lines in this section that you have not seen before. The first is printable, which identifies this share as a printer. The default for this option is no, meaning that by default, shares are considered to be file shares instead of printer shares. When you create a printer share, you must set this option to yes. Enabling printable permits clients to write printer files to the spool directory defined by the path option. This appears to contradict the writable command that says clients cannot write to the share. The writable option is there to say that no one can write a file to the spool that is not a print file. Because print files are created by clients in the spool directory, you may want to add a create mode command that limits the permissions of the files created. For example, create mode = 0700.

The other new line, guest ok, defines whether or not guest accounts are permitted access to the resource. This is exactly the same as the public option discussed in Chapter 9, so these two options are used interchangeably. no means that the user nobody cannot send a print job to the printer. A user must have a valid user account to use the printer. This is designed to prevent guest users from abusing the printer, but it is also useful to have a valid username for sorting out print jobs if you use banner pages and accounting on your server.

Generally, this section is all you need to make every printer on the server available to all of your clients. You can use the host allow command described in Chapter 9 to restrict access to printers in the same way that you restrict access to files, but in general, a printer server offers all of its printers to all of its clients.

Was this article helpful?

0 0

Post a comment