The best way to understand the SMB configuration file is to look at one that works. Red Hat systems come with a preconfigured smb.conf file that includes support for sharing printers. The active lines in the Red Hat smb.conf file are shown in Listing 10.6.
Listing 10.6: smb.conf with Printer Sharing
workgroup = MYGROUP server string = Samba Server printcap name = /etc/printcap load printers = yes 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 = TCP_NODELAY 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 [printers]
comment = All Printers path = /var/spool/samba browseable = no guest ok = no writable = no printable = yes
You saw many of these lines in Chapter 9, so you already know to change the workgroup option to the correct workgroup name for your network and to change the server string to something meaningful that describes your server. Some of these lines, however, were not covered in that chapter. All of the new lines deal with sharing printers. Three of the new lines are in the global section:
printcap name Defines the location of the printcap file. As you'll see in a minute, the printcap file is used to identify the printers that are available to share. The default path is / etc/printcap, which is the value set in Listing 10.6.
load printers Tells smbd whether or not it should offer all of the printers in the printcap file as shared printers. The default is yes, which tells Samba to share all of the printers defined in the printcap file. no means do not read the printcap file at all. If no is specified, all shared printers must be defined individually. In Listing 10.6, this is set to yes, so the Red Hat configuration will share every printer defined in /etc/printcap.
printing Identifies the printing system used on the server. Samba supports eight different printing systems identified by these keywords: BSD, AIX, LPRNG, PLP, SYSV, HPUX, QNX, SOFTQ, and CUPS. Select the printing system used by your Linux system. Red Hat Linux 7.2 uses LPRng, which is identified by the keyword lprng in Listing 10.6.
These lines are used to prepare the server for printer sharing and to prepare it to automatically share the printers defined in the printcap file. In addition to these global lines, there is an entire share section labeled "printers." It also deals with automatically sharing printers.
Was this article helpful?