If you don't want to share every printer defined in the printcap file, you can remove the printers section, set the load printers option to no, and add individual share sections for just those printers that you do want to share. Individual share sections can be created for each printer in the same way that they are created for file sharing. In addition to the printer configuration options described previously, you can use any relevant options described in Chapter 9.
An smb.conf file with a share section for a specific printer might contain the following:
workgroup = SYBEX
server string = Author's Printer server load printers = no printing = lprng log file = /var/log/samba/%m.log max log size = 0 security = user encrypt passwords = yes smb passwd file = /etc/samba/smbpasswd socket options = SO_RCVBUF=8192 SO_SNDBUF=8192 dns proxy = no [homes]
comment = Home Directories browseable = no writable = yes valid users = %S create mode = 0664 directory mode = 0775 [hp5m]
comment = PostScript Laser Printer path = /var/spool/samba browsable = no public = no writable = no create mode = 0700
printable = yes printer = lp
In this case, no printers section is included. Instead, a share section named hp5m is added that shares printer lp. The printer name (lp) must be found in the printcap file for this to work. The printcap name parameter is allowed to default to /etc/printcap.
Was this article helpful?