<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://commons.oreilly.com/wiki/skins/common/feed.css?97"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Linux in a Windows World/Sharing Files and Printers/File and Printer Shares - Revision history</title>
		<link>http://commons.oreilly.com/wiki/index.php?title=Linux_in_a_Windows_World/Sharing_Files_and_Printers/File_and_Printer_Shares&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.11.0</generator>
		<lastBuildDate>Thu, 23 May 2013 12:31:18 GMT</lastBuildDate>
		<item>
			<title>Docbook2Wiki: Initial conversion from Docbook</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Linux_in_a_Windows_World/Sharing_Files_and_Printers/File_and_Printer_Shares&amp;diff=9547&amp;oldid=prev</link>
			<description>&lt;p&gt;Initial conversion from Docbook&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:06, 11 March 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/table&gt;</description>
			<pubDate>Tue, 11 Mar 2008 23:06:43 GMT</pubDate>			<dc:creator>Docbook2Wiki</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Linux_in_a_Windows_World/Sharing_Files_and_Printers/File_and_Printer_Shares</comments>		</item>
		<item>
			<title>Docbook2Wiki: Initial conversion from Docbook</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Linux_in_a_Windows_World/Sharing_Files_and_Printers/File_and_Printer_Shares&amp;diff=8769&amp;oldid=prev</link>
			<description>&lt;p&gt;Initial conversion from Docbook&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Linux in a Windows World/TOC}}&lt;br /&gt;
[[Linux in a Windows World/Sharing Files and Printers/Basic Samba Configuration|Chapter 3]] described basic Samba configuration—assigning NetBIOS and workgroup names to the Samba server, setting password options, and so on. In most cases, though, a Samba server's primary responsibility is to provide file and printer shares to clients. This is the topic of this chapter.&lt;br /&gt;
&lt;br /&gt;
This chapter begins with a look at file shares—how to define them, set access options, and so on. Printer shares are basically just variants of file shares, but because they must interface with the Linux printing system, this chapter describes a few details of Linux's printing architecture, including the basics of configuring the Common Unix Printing System, the most popular printing software on Linux. Another printing-related feature is the delivery of printer drivers to Windows systems; SMB/CIFS and Samba support special options to handle this task. Finally, this chapter concludes with several example shares that demonstrate common file- and printer-sharing scenarios.&lt;br /&gt;
&lt;br /&gt;
== Common File Share Options ==&lt;br /&gt;
&lt;br /&gt;
At many sites, file sharing is the most important duty of a Samba server. File shares can store users' data files and programs run by many users, exchange data between users, be part of a network backup system, and serve other purposes. (Examples of shares for many of these roles appear in the later [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Example Shares|Section 4.5]].) You can create a basic file share with just one line in ''smb.conf'', but fine-tuning it to do what you want will take more lines. Options you may want to tune include those that control write access to the share, those that adjust how Samba reports filenames to clients, and those that influence local Linux or client filesystem security features.&lt;br /&gt;
&lt;br /&gt;
=== Defining a File Share ===&lt;br /&gt;
&lt;br /&gt;
A minimal file share consists of a single line that contains the share name in square brackets:&lt;br /&gt;
&lt;br /&gt;
 [sample]&lt;br /&gt;
&lt;br /&gt;
If you include this line in ''smb.conf'' at the end of the file, or with another share definition immediately following it, Samba will create a file share called ''SAMPLE''. This share will be a read-only share corresponding to the ''/tmp'' directory on the server. Chances are these options aren't the ones you want. At a minimum, you'll almost certainly want to use the &amp;lt;tt&amp;gt;path&amp;lt;/tt&amp;gt; parameter or its synonym, &amp;lt;tt&amp;gt;directory&amp;lt;/tt&amp;gt;. These parameters tell Samba what directory to use as the root of the share you define. For instance, to share ''/var/samba/somedir'', you might enter a share definition like this:&lt;br /&gt;
&lt;br /&gt;
 [sample]&lt;br /&gt;
    path = /var/samba/somedir&lt;br /&gt;
&lt;br /&gt;
This entry creates a file share that appears in Windows network browsers as ''SAMPLE'', just like the previous definition; but this share provides read-only access to files in ''/var/samba/somedir''. Note that the share name (''SAMPLE'' in this example) and the name of the directory to be shared (''/var/samba/somedir'') are unrelated. Of course, they ''could'' be related, and doing so can help you administer your system, but doing it isn't strictly necessary. Other share-level options you might want to use include the following:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;available&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This parameter's value defaults to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, which makes the share available. If you want to temporarily disable a share, you can set &amp;lt;tt&amp;gt;available&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt;. (This won't work for the &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; share, which is described in the later [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#The [homes] Share|Section 4.5.1]].) The effect is much the same as commenting out or deleting the entire share definition.&lt;br /&gt;
;&amp;lt;tt&amp;gt;comment&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level parameter is a share's equivalent of the global &amp;lt;tt&amp;gt;server&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;string&amp;lt;/tt&amp;gt; parameter; it creates a description of the share that's visible from clients' file browsers.&lt;br /&gt;
;&amp;lt;tt&amp;gt;browseable&amp;lt;/tt&amp;gt;&lt;br /&gt;
: Shares that are ''browseable'' appear in file browsers on clients. Those that aren't browseable don't appear in browse lists but are still accessible to users who type the share name into an access tool. By default, Samba makes file shares browseable, but you can hide them by setting &amp;lt;tt&amp;gt;browseable&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt;. This parameter is also usually set to &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt; for &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; shares, as described in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#The [homes] Share|Section 4.5.1]].&lt;br /&gt;
&lt;br /&gt;
=== Setting Write Access ===&lt;br /&gt;
&lt;br /&gt;
The default for Samba file shares is to provide read-only access. Of course, many types of shares must be read/write in order to be useful, so Samba provides a way to provide this type of access—in fact, several ways. The &amp;lt;tt&amp;gt;writeable&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;writable&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;write&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;ok&amp;lt;/tt&amp;gt; parameters are all synonyms, and when any of them is set to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, read/write access to the share becomes possible. The &amp;lt;tt&amp;gt;read&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;only&amp;lt;/tt&amp;gt; parameter is an antonym for these parameters; setting &amp;lt;tt&amp;gt;read only = No&amp;lt;/tt&amp;gt; has the same effect as setting &amp;lt;tt&amp;gt;writeable = Yes&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In addition to the critical &amp;lt;tt&amp;gt;writeable&amp;lt;/tt&amp;gt; parameter or one of its synonyms, several other parameters affect write access to the share based on other features:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;invalid users&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level parameter doesn't strictly affect write access; instead, it provides a list of users who are denied all access to the share. All users who aren't explicitly listed are granted access to the share. You can specify a Linux group by preceding its name with an at sign (&amp;lt;tt&amp;gt;@&amp;lt;/tt&amp;gt;) or a plus sign (&amp;lt;tt&amp;gt;+&amp;lt;/tt&amp;gt;), as in &amp;lt;tt&amp;gt;@students&amp;lt;/tt&amp;gt;. (The &amp;lt;tt&amp;gt;@&amp;lt;/tt&amp;gt; sign first attempts to look up a netgroup name and then uses the local group database. The plus sign uses the local group database alone.)&lt;br /&gt;
;&amp;lt;tt&amp;gt;read list&amp;lt;/tt&amp;gt;&lt;br /&gt;
: You can provide a list of users who are permitted only to read the files on an otherwise read/write share with this share-level parameter.&lt;br /&gt;
;&amp;lt;tt&amp;gt;valid users&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level parameter is the opposite of &amp;lt;tt&amp;gt;invalid&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;users&amp;lt;/tt&amp;gt;; it provides a list of users who are permitted to access the share. Attempts by other users to access the share are denied. You can specify a Linux group by preceding its name with an at sign (&amp;lt;tt&amp;gt;@&amp;lt;/tt&amp;gt;) or a plus sign (&amp;lt;tt&amp;gt;+&amp;lt;/tt&amp;gt;), as in &amp;lt;tt&amp;gt;@students&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;write list&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level parameter is the opposite of &amp;lt;tt&amp;gt;read&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt;; you provide a list of users who are permitted to write to an otherwise read-only share. It's often used to specify share administrators who may add files to a share.&lt;br /&gt;
&lt;br /&gt;
Setting &amp;lt;tt&amp;gt;writeable&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, one of its synonyms, or one of the modifier parameters, is enough to provide read/write access to a shared directory from Samba's perspective, but you must also consider the underlying Linux permissions. In most cases, Samba uses the access rights of the user who initiated a connection. For instance, if the user ''linnaeus'' is accessing a share, and if ''linnaeus'' doesn't have write access to a directory, Samba won't be able to save files in that directory for this user. Thus, you should consider user access rights from a traditional Linux permissions perspective when preparing file shares. Modifying Samba's permissions system is described in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Setting Access Control Features|Section 4.1.4]], and practical examples of some systems are described in the [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Example Shares|Section 4.5]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
Samba provides some extremely powerful options for modifying both read and write access to its shares. As a general rule, though, it's best to keep it simple; overuse of sophisticated access control tools can create a complicated configuration that will easily break. Worse, you might inadvertently create a security hole that a user can exploit accidentally or deliberately.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting Filename Options ===&lt;br /&gt;
&lt;br /&gt;
Windows and Linux make different assumptions about filenames. Because SMB/CIFS is so strongly associated with Windows and related clients, Samba is designed around the Windows assumptions. The problem comes in translating filenames stored on a Linux filesystem into the format expected by Windows. Samba provides many parameters that help you accomplish this goal. Broadly speaking, differences come in a few areas:&lt;br /&gt;
&lt;br /&gt;
;Filename length&lt;br /&gt;
: Most Linux filesystems provide long filenames—typically up to 255 characters. Windows clients can use long filenames, but they also expect to see short filenames (eight characters with a three-character extension, or so-called ''8.3 filenames'') in addition to the long filenames. Older DOS clients can use only the short filenames. DOS and 16-bit Windows programs require short filenames even when they're run from more modern versions of Windows. Because Linux native filesystems store a single filename and don't automatically create shortened filenames that correspond to long filenames, Samba generates short filenames on the fly, using a process called ''filename mangling'' . Samba provides several parameters that enable you to fine-tune this mangling process.&lt;br /&gt;
;Filename case&lt;br /&gt;
: Linux filesystems are ''case-sensitive'' ; two filenames that differ only in case, such as ''afile.txt'' and ''AFile.TXT'', are considered unique. Both files can exist in a single directory, and if you enter the filename's case incorrectly, Linux won't be able to access an existing file. Windows, by contrast, is ''case-retentive'': filename case is preserved when you save a file, but the OS doesn't care about case when you specify a filename. This means that two files that differ only in case can't exist in the same directory. DOS is even more primitive; it uses completely ''case-insensitive'' filenames. DOS stores all filenames entirely in uppercase. (DOS programs can usually access lowercase filenames on a Samba server, though.) Samba provides case-sensitivity options, some of which interact with filename mangling options, to accommodate these different case-handling systems.&lt;br /&gt;
;Character sets&lt;br /&gt;
: Traditionally, filenames have been stored on both Windows and Linux filesystems using the American Standard Code for Information Interchange (ASCII). ASCII is inadequate, though, for storing filenames that contain letters from non-Roman alphabets, such as Cyrillic or Arabic letters. An older solution to this problem involved ''code pages'' , which are basically alternatives to ASCII. A more modern solution uses ''Unicode'' , which uses a 16-bit encoding system for characters, thus greatly increasing the number of characters that can be used in filenames. Samba must have a way to translate between either system and the filenames actually stored on the disk.&lt;br /&gt;
&lt;br /&gt;
As a general rule, Samba's default options work well. These defaults cause Samba to present the illusion of a case-retentive filesystem with both long and short filenames. Samba does this by looking for files that differ only in case when a provided filename can't be found, and by creating mangled filenames to go along with long filenames when the client requests them. Sometimes, though, you may need to tweak these settings by using some parameters:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;case sensitive&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level Boolean parameter controls whether Samba treats filename access in a case-sensitive way. The default value of &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt; works well with DOS and Windows clients, and, in fact, DOS and Windows 9x/Me clients will likely misbehave in various ways if you set this option to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;. Windows NT/200x/XP is better at handling case-sensitive filenames, but &amp;lt;tt&amp;gt;case&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;sensitive&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt; is still the preferred option for it. Some Linux and Unix clients may work better with &amp;lt;tt&amp;gt;case&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;sensitive&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, but this setting usually isn't required even for these clients. Samba 3.0.6 introduced the &amp;lt;tt&amp;gt;Auto&amp;lt;/tt&amp;gt; value for this option and made it the default. This setting enables the server to detect some clients' preferred case sensitivity and should work with the Linux &amp;lt;tt&amp;gt;cifs&amp;lt;/tt&amp;gt; filesystem, among others.&lt;br /&gt;
;&amp;lt;tt&amp;gt;preserve case&amp;lt;/tt&amp;gt;&lt;br /&gt;
: When set to the default value, &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, this share-level Boolean parameter causes Samba to store new files in the same case as provided by clients. When set to &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt;, Samba converts filenames to the case specified by &amp;lt;tt&amp;gt;default&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;case&amp;lt;/tt&amp;gt; (described shortly). Setting this option to &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt; can be handy if you have clients that generate ugly all-uppercase filenames, and you want to access the files from other clients.&lt;br /&gt;
;&amp;lt;tt&amp;gt;short preserve case&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This parameter works just like &amp;lt;tt&amp;gt;preserve&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;case&amp;lt;/tt&amp;gt;, but it applies only to short (8.3) filenames.&lt;br /&gt;
;&amp;lt;tt&amp;gt;default case&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level parameter accepts values of &amp;lt;tt&amp;gt;Upper&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Lower&amp;lt;/tt&amp;gt;. It defaults to &amp;lt;tt&amp;gt;Lower&amp;lt;/tt&amp;gt;, but this default is meaningless unless you set either &amp;lt;tt&amp;gt;preserve&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;case&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;short&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;preserve&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;case&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt;. If you do so, Samba converts newly created filenames to the specified case.&lt;br /&gt;
;&amp;lt;tt&amp;gt;mangled names&amp;lt;/tt&amp;gt;&lt;br /&gt;
: When set to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt; (the default), this share-level Boolean parameter causes Samba to generate mangled filenames for files longer than the DOS 8.3 limits. These names are delivered in addition to the regular filenames, so this option won't cause problems for clients that expect long filenames. This feature is most important for DOS clients, but it can also be important for Windows clients that run DOS or 16-bit Windows programs.&lt;br /&gt;
;&amp;lt;tt&amp;gt;mangle case&amp;lt;/tt&amp;gt;&lt;br /&gt;
: Ordinarily, Samba doesn't mangle short filenames that don't match the client's case expectations. If you set &amp;lt;tt&amp;gt;mangle&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;case&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, though, Samba mangles filenames that aren't entirely in the case specified by &amp;lt;tt&amp;gt;default case&amp;lt;/tt&amp;gt;. Chances are this action won't be necessary, and in fact it's likely to produce very ugly results, but it's conceivable you'll run across some DOS programs that choke on lowercase names, in which case using this option may be your only solution. This option was eliminated over the development of the 3.0.x versions of Samba.&lt;br /&gt;
;&amp;lt;tt&amp;gt;mangled map&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level option specifies pairs of filename wildcards that should be mangled in particular ways. For instance, &amp;lt;tt&amp;gt;mangled&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;map&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;(*.html&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;*.htm)&amp;lt;/tt&amp;gt; converts all filenames that end in ''.html'' so that they end in ''.htm'' instead. Unlike other mangling options, this one applies to all filenames, not just those delivered to DOS or as short filename alternatives to Windows clients. This option is not being actively maintained and so may develop bugs in the future.&lt;br /&gt;
;&amp;lt;tt&amp;gt;mangling method&amp;lt;/tt&amp;gt;&lt;br /&gt;
: Samba uses one of two methods to create mangled filenames. You can specify which method to use with this global parameter, which accepts values of &amp;lt;tt&amp;gt;hash&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;hash2&amp;lt;/tt&amp;gt;. The latter option, which is the default with Samba 3.0 and later, produces filenames that bear less resemblance to the original than does the first, but &amp;lt;tt&amp;gt;hash2&amp;lt;/tt&amp;gt; is also less likely to produce ''collisions'' —identical hashes derived from different original filenames.&lt;br /&gt;
;&amp;lt;tt&amp;gt;mangle prefix&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This global parameter sets the number of characters to be preserved from the original filename when creating a mangled filename using the &amp;lt;tt&amp;gt;hash2&amp;lt;/tt&amp;gt; mangling method. The default value is &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;, but you can improve the intelligibility of mangled filenames by increasing this value (the maximum is &amp;lt;tt&amp;gt;6&amp;lt;/tt&amp;gt;).&lt;br /&gt;
;&amp;lt;tt&amp;gt;unicode&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This global Boolean parameter defaults to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, which tells Samba to support Unicode filenames provided by clients. Normally there's no need to change this parameter. It's available only in early 3.0.x releases and has been dropped in later versions.&lt;br /&gt;
;&amp;lt;tt&amp;gt;dos charset&amp;lt;/tt&amp;gt;&lt;br /&gt;
: You can tell Samba what code page to use when communicating with older clients that don't support Unicode with this global parameter. You specify code pages using three-digit codes preceded by the string &amp;lt;tt&amp;gt;CP&amp;lt;/tt&amp;gt;, as in &amp;lt;tt&amp;gt;CP850&amp;lt;/tt&amp;gt; (Latin 1, which works well for most North American systems) or &amp;lt;tt&amp;gt;CP866&amp;lt;/tt&amp;gt; (Cyrillic). This option is new with Samba 3.0.&lt;br /&gt;
;&amp;lt;tt&amp;gt;unix charset&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This global parameter sets the name of the character set Linux uses for its filenames. The default value is &amp;lt;tt&amp;gt;UTF8&amp;lt;/tt&amp;gt;. This value stands for Unicode Transformation Format 8, which is a method of encoding Unicode in an 8-bit character set such as ASCII. Ordinarily, you won't change this option, which is new with Samba 3.0.&lt;br /&gt;
;&amp;lt;tt&amp;gt;client code page&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This global parameter was used through the 2.2.x versions of Samba as a way to specify what code page the client used. It's since been replaced by &amp;lt;tt&amp;gt;dos&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;charset&amp;lt;/tt&amp;gt;. This parameter takes code page numbers without a preceding &amp;lt;tt&amp;gt;CP&amp;lt;/tt&amp;gt; string, as in &amp;lt;tt&amp;gt;850&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;866&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;character set&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This global parameter was used in Samba through the 2.2.x series to tell the server how to encode different code pages on the server's filesystem. Values were character set values, such as &amp;lt;tt&amp;gt;ISO8859-1&amp;lt;/tt&amp;gt; (Latin 1) or &amp;lt;tt&amp;gt;KOI8-R&amp;lt;/tt&amp;gt; (Cyrillic). This parameter has been replaced by &amp;lt;tt&amp;gt;unix charset&amp;lt;/tt&amp;gt; in Samba 3.0 and later.&lt;br /&gt;
&lt;br /&gt;
This list of parameters may be intimidating (and I've even left out some of the more exotic options!), but in most cases, you need not change any of these values. When dealing with DOS clients, though, you might want to adjust the &amp;lt;tt&amp;gt;short&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;preserve&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;case&amp;lt;/tt&amp;gt; option, if you want to force DOS filenames to appear in all-lowercase on the server. (This will make them look better in most non-DOS clients.) Changing &amp;lt;tt&amp;gt;mangle&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;prefix&amp;lt;/tt&amp;gt; can improve the intelligibility of mangled filenames on DOS clients. Linux and Unix clients can benefit from setting &amp;lt;tt&amp;gt;case&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;sensitive&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, but this change isn't usually required. (For versions of Samba that support &amp;lt;tt&amp;gt;Auto&amp;lt;/tt&amp;gt; for this parameter, using this feature is usually better, too.) If your users regularly create files with non-ASCII filenames, you may need to investigate the various character set and code page options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
You can place filename options in OS-specific configuration files and use the &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; parameter with the &amp;lt;tt&amp;gt;%a&amp;lt;/tt&amp;gt; variable in the &amp;lt;tt&amp;gt;[global]&amp;lt;/tt&amp;gt; section to load them only for appropriate client OSs. For instance, add &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;smb-%a.conf&amp;lt;/tt&amp;gt; to ''smb.conf'' and then create files called ''smb-WfW.conf'', ''smb-Samba.conf'', and so on, in which you store OS-specific options. [[Linux in a Windows World/Sharing Files and Printers/Basic Samba Configuration#linuxwinworld-CHP-3-TABLE-1|Table 3-1]] describes the &amp;lt;tt&amp;gt;%a&amp;lt;/tt&amp;gt; variable and its possible values.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting Access Control Features ===&lt;br /&gt;
&lt;br /&gt;
Linux uses Unix-style access control mechanisms, which provide read, write, and execute permissions for each of three classes of users: the file's owner, the file's group, and all other users (a.k.a. world access). Linux also provides access control lists (ACLs) in most of its native filesystems, although Linux ACL support is still new and few programs are designed with it in mind.&lt;br /&gt;
&lt;br /&gt;
Windows and SMB/CIFS, by contrast, originally provided little in the way of access controls; users who mounted a share were given access to all files on the share. Windows NT/200x/XP, though, provides ACLs similar to Linux ACLs. Integrating these two access control heritages can be tricky sometimes, particularly because Samba must support both older clients that don't use ACLs and newer clients that do. In order to accomplish this task, Samba provides a series of options that affect the way it treats Linux file ownership, Linux file permissions, DOS-style filesystem features, and ACLs. Recent versions of Samba also support ''Unix extensions'' , which are extensions to SMB/CIFS that more directly support Unix-style ownership and permissions. Samba's Unix extensions support is intended for Linux or Unix clients.&lt;br /&gt;
&lt;br /&gt;
==== Setting Linux ownership ====&lt;br /&gt;
&lt;br /&gt;
Linux's local file security model relies heavily on the concept of file ownership—both the file's owner and the file's group. In order to interface Samba clients with this system, Samba provides several ''smb.conf'' parameters that affect the ownership of files a user creates. In conjunction with existing files' permissions, Samba's ownership parameters also influence whether a user is granted the right to read or change an existing file. The most important of these parameters are as follows:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;force user&amp;lt;/tt&amp;gt;&lt;br /&gt;
: You can pass a local Linux username to this share-level parameter to have Samba treat all file accesses as if they originated with the specified user. For instance, &amp;lt;tt&amp;gt;force&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;user&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;linnaeus&amp;lt;/tt&amp;gt; tells Samba to give the user read access to those files that ''linnaeus'' can read, write access to files that ''linnaeus'' can write, and so on. Files created when accessing the share are owned by ''linnaeus''. In addition, unless you use &amp;lt;tt&amp;gt;force&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;group&amp;lt;/tt&amp;gt;, the group used for accesses is set to the specified user's default group. The default is to use the account of the username provided by the user (or mapped by &amp;lt;tt&amp;gt;username map&amp;lt;/tt&amp;gt;, if you employ that parameter).&lt;br /&gt;
;&amp;lt;tt&amp;gt;force group&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level parameter is similar to &amp;lt;tt&amp;gt;force user&amp;lt;/tt&amp;gt;, but it applies to the group used for file accesses. A synonym for this parameter is &amp;lt;tt&amp;gt;group&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;guest ok&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This Boolean share-level parameter tells Samba whether to accept ''guest'' accesses to the share—that is, accesses without the benefit of a password. If &amp;lt;tt&amp;gt;guest ok = Yes&amp;lt;/tt&amp;gt; and if a guest logon occurs, Samba uses the account specified by &amp;lt;tt&amp;gt;guest account&amp;lt;/tt&amp;gt; for accesses, much as if &amp;lt;tt&amp;gt;force user&amp;lt;/tt&amp;gt; had been used. A synonym for this parameter is &amp;lt;tt&amp;gt;public&amp;lt;/tt&amp;gt;. Note that the global &amp;lt;tt&amp;gt;map to guest&amp;lt;/tt&amp;gt; parameter must also be set appropriately before this parameter will work.&lt;br /&gt;
;&amp;lt;tt&amp;gt;guest account&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This global option sets the account used for guest accesses, as authorized on a share-by-share basis by &amp;lt;tt&amp;gt;guest ok&amp;lt;/tt&amp;gt;. The default value is a compile-time option, but it's usually set to &amp;lt;tt&amp;gt;nobody&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;map to guest&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This global parameter controls the conditions that trigger a guest logon. Samba accepts values of &amp;lt;tt&amp;gt;Never&amp;lt;/tt&amp;gt; (Samba never accepts a guest logon; this is the default value), &amp;lt;tt&amp;gt;Bad User&amp;lt;/tt&amp;gt; (Samba accepts a guest logon when a user specifies an invalid username), and &amp;lt;tt&amp;gt;Bad Password&amp;lt;/tt&amp;gt; (Samba accepts a guest logon when a user specifies an invalid username or password).&lt;br /&gt;
&lt;br /&gt;
Generally speaking, the best approach is to use Samba's default options. Forcing Samba to use particular users or groups can be a convenient way to avoid having to set permissions properly on files (including ensuring that Samba sets them in a sensible way), but forcing a user or group also means that you'll lose information. Should strange files begin appearing, for instance, it may become very difficult to track down who's creating the files if you use &amp;lt;tt&amp;gt;force user&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Setting Linux permissions ====&lt;br /&gt;
&lt;br /&gt;
File ownership alone doesn't go very far in Linux. To be effective, ownership must be paired with file permissions (a.k.a. the file ''mode''). Linux's traditional Unix-style permissions apply read, write, and execute permissions to each of three classes of users: the owner, the group, and the world. Each of these permissions is a single bit, for a total of nine bits of permission information. These may be expressed as a string, as in &amp;lt;tt&amp;gt;rwxr-x---&amp;lt;/tt&amp;gt;, in which a dash (&amp;lt;tt&amp;gt;-&amp;lt;/tt&amp;gt;) stands for no permission and an &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; stands for read, write, or execute permission, respectively. Alternatively, ownership may be expressed as three octal (base-8) numbers corresponding to the 3-bit value for read, write, and execute permission, as in 750 for &amp;lt;tt&amp;gt;rwxr-x---&amp;lt;/tt&amp;gt;. A leading 0 is often added to the octal form of the mode; higher values signify some special file-permission bits. A leading dash is often added to the string value. This dash is replaced by other characters to signify particular file types, such as &amp;lt;tt&amp;gt;d&amp;lt;/tt&amp;gt; for a directory.&lt;br /&gt;
&lt;br /&gt;
Because DOS and Windows know nothing about Unix-style permissions, and therefore don't pass information on appropriate permissions when creating new files, Samba must generate this information. It does so as specified by these parameters:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;create mask&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level parameter specifies the default and maximum permissions to apply to new files created by the client. It's expressed in an octal form, as in &amp;lt;tt&amp;gt;create&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;mask&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;744&amp;lt;/tt&amp;gt; (the default value). Note that clients can remove write access by setting the DOS read-only flag. If you enable any execute permissions (by specifying an odd value for any of the three octal digits), they can also be removed by the client if the appropriate DOS attribute mappings are configured, as described in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Mapping DOS-style flags|Section 4.1.4.3]]. A synonym for this parameter is &amp;lt;tt&amp;gt;create mode&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;directory mask&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level parameter works just like &amp;lt;tt&amp;gt;create mask&amp;lt;/tt&amp;gt;, except that it applies to directories rather than files. Because Linux requires the execute permission bit to be set on directories for some read operations, this parameter typically uses octal values of 7, 5, or 0, as in &amp;lt;tt&amp;gt;directory&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;mask&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;755&amp;lt;/tt&amp;gt; (the default value). A synonym for this parameter is &amp;lt;tt&amp;gt;directory mode&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;inherit permissions&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level Boolean parameter defaults to &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt;, but if you set it to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, it overrides &amp;lt;tt&amp;gt;create mask&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;directory mask&amp;lt;/tt&amp;gt;. In this case, files and directories acquire permissions based on the values of their parent directories. (The execute bits of parent directories are stripped when creating files, however.) For instance, if a directory has a mode of 750 and a user creates a subdirectory in that directory, it will also have a mode of 750.&lt;br /&gt;
&lt;br /&gt;
You should give careful thought to the values you specify for these parameters. Setting permissions too loosely can enable users who don't own the file the ability to read (or potentially even write) files and directories to which they should have no access. On the other side, setting these values too strictly can deny access to users who should be able to read or write files. Precisely what policy is right varies from one site to another, and perhaps even one share to another. Several examples appear in the [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Example Shares|Section 4.5]].&lt;br /&gt;
&lt;br /&gt;
==== Mapping DOS-style flags ====&lt;br /&gt;
&lt;br /&gt;
DOS and its descendent operating systems, including Windows, support several filesystem flags that don't appear in Linux or Unix filesystems. In order to support these flags, Samba can optionally map them onto the execute permission bit, which DOS and Windows don't use. Several parameters control this mapping:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;map archive&amp;lt;/tt&amp;gt;&lt;br /&gt;
: The DOS/Windows ''archive bit'' is set when a file is created and cleared when it's backed up with certain backup tools. If you set &amp;lt;tt&amp;gt;map&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;archive&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt; (the default), Samba maps this bit to the owner execute bit.&lt;br /&gt;
;&amp;lt;tt&amp;gt;map hidden&amp;lt;/tt&amp;gt;&lt;br /&gt;
: The DOS/Windows ''hidden bit'' signals certain programs, such as file managers, to hide the presence of a file from users. The file is still accessible but won't appear in file listings. This bit can be used to hide files that would likely confuse users. If you set &amp;lt;tt&amp;gt;map&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;hidden&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;= Yes&amp;lt;/tt&amp;gt; (the default is &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt;), Samba stores this bit using the world execute bit.&lt;br /&gt;
;&amp;lt;tt&amp;gt;map system&amp;lt;/tt&amp;gt;&lt;br /&gt;
: The DOS/Windows ''system bit'' marks certain critical OS files as such. Most file managers hide these files, and some utilities treat them differently from other files. Chances are you won't be storing system files on a Samba server, so the default value of this parameter is &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt;, but if you set it to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, Samba stores this bit in the group execute bit.&lt;br /&gt;
;&amp;lt;tt&amp;gt;store dos attributes&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level Boolean parameter defaults to &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt;. When set to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt; and when the preceding three options are all set to &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;store dos attributes&amp;lt;/tt&amp;gt; causes Samba to store the DOS-style archive, hidden, and system attributes as extended attributes (EAs) on the Linux filesystem. EAs are supported only on the 2.6.x and later kernels and require the &amp;lt;tt&amp;gt;user_xattr&amp;lt;/tt&amp;gt; filesystem mount option. They also require explicit filesystem support, which is present in ext2fs, ext3fs, ReiserFS, JFS, and XFS, but Linux doesn't support EAs in most non-Linux filesystems. One advantage of this parameter is that it supports storing attributes for directories as well as files. This parameter was added to Version 3.0.3 of Samba.&lt;br /&gt;
&lt;br /&gt;
The first three of these parameters interact with the settings of the &amp;lt;tt&amp;gt;create mask&amp;lt;/tt&amp;gt; parameter; if ''either'' &amp;lt;tt&amp;gt;create mask&amp;lt;/tt&amp;gt; or the appropriate mapping parameter disables a particular execute bit, users can't set the matching DOS/Windows flag. The mapping works both ways; if you enable a mapping and then create a file under Linux that has execute permissions set (say, a script), it appears to Samba clients with the archive, hidden, or system bits set. For this reason, if you wish to let users legitimately create executable Linux files, leave these parameters at the default; this prevents the files from disappearing from view in Samba clients because of hidden or system bits appearing on these files. Disabling the archive bit (either by setting &amp;lt;tt&amp;gt;map archive = No&amp;lt;/tt&amp;gt; or by setting a &amp;lt;tt&amp;gt;create mask&amp;lt;/tt&amp;gt; value that disables access to the user execute bit) prevents files created on Samba clients from appearing under Linux as executable files.&lt;br /&gt;
&lt;br /&gt;
Under Linux, the equivalent of hidden files are ''dot files''—files whose names begin with dots (.). If a share will be accessible both from Samba clients and from Linux logins, you may want to ensure that &amp;lt;tt&amp;gt;hide dot files&amp;lt;/tt&amp;gt; is set to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, as it is by default. This option tells Samba to set the hidden bit on all Linux dot files, no matter what the setting s of the world execute bit and the &amp;lt;tt&amp;gt;map hidden&amp;lt;/tt&amp;gt; parameter are.&lt;br /&gt;
&lt;br /&gt;
==== Using ACLs ====&lt;br /&gt;
&lt;br /&gt;
ACLs provide a finer-grained method of access control than do Unix-style permissions. Windows NT has long supported ACLs on its New Technology File System (NTFS), and SMB/CIFS also supports ACLs. This support has only recently started to become common with Linux, though. In particular, the 2.6.x kernel series adds ACL support to most common Linux filesystems—as of the 2.6.7 kernel, ext2fs, ext3fs, JFS, and XFS all support ACLs. (With earlier kernels and most common Linux filesystems, you had to patch the kernel to add ACL support. Consult ''http://acl.bestbits.at'' for details.)&lt;br /&gt;
&lt;br /&gt;
Samba has long supported the SMB/CIFS ACLs as a tool for accessing Unix-style permissions from Windows NT/200x/XP systems. If you use an ACL-enabled filesystem, this same support gives Windows users fuller access to the Linux filesystem's ACL features. This support is, however, a compile-time option. To determine whether your Samba binary includes ACL support, type &amp;lt;tt&amp;gt;'''smbd'''&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;'''-b'''&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;'''|'''&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;'''grep'''&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;'''-i'''&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;'''HAVE.*ACL'''&amp;lt;/tt&amp;gt;. The result is a list of the ACL features in the ''smbd'' binary. The following parameters control this support:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;inherit acls&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This Boolean share-level parameter is similar to &amp;lt;tt&amp;gt;inherit&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;permissions&amp;lt;/tt&amp;gt;, but it tells Samba to copy ACLs from a parent directory when creating new subdirectories. The default value is &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;nt acl support&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This Boolean share-level parameter is the key ACL feature; setting it to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt; tells Samba to enable SMB/CIFS ACL support, mapping it to the server's Unix-style permissions and, if supported, local filesystem ACLs.&lt;br /&gt;
;&amp;lt;tt&amp;gt;security mask&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level parameter tells Samba which Unix-style permissions should be accessible to clients. The default value (&amp;lt;tt&amp;gt;777&amp;lt;/tt&amp;gt;) gives users access to all the Unix-style permission bits.&lt;br /&gt;
;&amp;lt;tt&amp;gt;directory security mask&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level parameter works just like &amp;lt;tt&amp;gt;security mask&amp;lt;/tt&amp;gt;, but it applies to directories rather than files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
Samba's ACL features require the client to know more about the underlying Linux accounts than is necessary for most other purposes. Samba can most easily provide this information in user- or domain-level security modes (set with the &amp;lt;tt&amp;gt;security&amp;lt;/tt&amp;gt; parameter, as described in [[Linux in a Windows World/Sharing Files and Printers/Basic Samba Configuration|Chapter 3]]). Attempting to use ACLs when using share- or server-level security is likely to cause problems. In the case of share-level security, username mapping can vary between logins; for server-level security, the authentication against the logon server is too convoluted to be traced properly by Samba.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whether your underlying filesystem supports ACLs or not, clients access these features using the file's Properties dialog box, which can be obtained by right-clicking the file in a Windows file browser and selecting Properties from the resulting dialog box. The Security tab provides access to the ACLs or Unix-style permissions, as shown in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#linuxwinworld-CHP-4-FIG-1|Figure 4-1]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;linuxwinworld-CHP-4-FIG-1&amp;quot;&amp;gt;&lt;br /&gt;
'''Figure 4-1. Windows ACL access tools work on Samba shares once they've been appropriately enabled'''&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux in a Windows World_I_2_tt23.png|Windows ACL access tools work on Samba shares once they've been appropriately enabled]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Precisely how you manipulate ACLs differs between Windows versions. [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#linuxwinworld-CHP-4-FIG-1|Figure 4-1]] shows a Windows 2000 dialog box, in which users can click on the appropriate box in the Allow column to enable or disable access. If your Samba server system supports true ACLs, users can also click the Add button to add a new ACL that gives some other user access to the file. Older versions of Windows used a more awkward ACL-access mechanism that involved more dialog boxes. Even if Samba supports ACLs, these features aren't accessible from Windows 9x/Me or from the Home version of Windows XP.&lt;br /&gt;
&lt;br /&gt;
==== Enabling Unix extensions ====&lt;br /&gt;
&lt;br /&gt;
Most Samba features are designed with Microsoft-style clients (DOS, Windows, or OS/2) in mind. A few, though, cater to other operating systems; &amp;lt;tt&amp;gt;unix&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;extensions&amp;lt;/tt&amp;gt; is one that may be of particular interest. It's a global Boolean parameter that tells Samba whether to support a set of SMB/CIFS extensions that deliver Unix-style filesystem data—Unix-style ownership, Unix-style permissions, and a few special file types such as hard and symbolic links. This parameter defaults to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt; in Samba 3.0 and later and shouldn't cause problems for non-Unix clients; thus, chances are you don't need to change it.&lt;br /&gt;
&lt;br /&gt;
In order to do any good, the &amp;lt;tt&amp;gt;unix extensions&amp;lt;/tt&amp;gt; parameter must be paired with a client that can use them. As the name suggests, these extensions are intended for use by Unix-like OSs; Windows clients can't use them. Some Linux clients can use them, though, including Samba's own ''smbclient'' and the &amp;lt;tt&amp;gt;cifs&amp;lt;/tt&amp;gt; filesystem type code for Linux's ''mount'' command. [[Linux in a Windows World/Sharing Files and Printers/Linux as an SMB/CIFS Client|Chapter 6]] describes how to use the Unix extensions from a Linux client computer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
Linux client-side Unix extensions support is still rather limited. Enabling it on the Samba server shouldn't do any harm, but for Linux-to-Linux (or Linux-to-Unix) file sharing, NFS still offers better support for Unix-style filesystem features than does Samba. This may change in the future as the Unix extensions support matures, both in Samba and in the Linux kernel.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printing with CUPS ==&lt;br /&gt;
&lt;br /&gt;
Although file shares are an important feature of many Samba servers, printer shares are also important. Before you can configure a Samba printer share, though, you must have a working local printer configuration. Most Linux distributions now use the Common Unix Printing System (CUPS; ''http://www.cups.org'') as the local printing software. Therefore, before moving on to describing Samba printer share configuration, I present some basic information on CUPS configuration.&lt;br /&gt;
&lt;br /&gt;
=== Installing CUPS ===&lt;br /&gt;
&lt;br /&gt;
Because CUPS is a standard part of most Linux distributions, it may be installed on your system already. Use your package tools to look for a package called ''cups''. If it's not installed, your computer either has no printing system installed or it uses an older printing system, such as LPRng or BSD LPD.&lt;br /&gt;
&lt;br /&gt;
If your system uses an older printing system, you can either uninstall it and install CUPS in its place or forgo CUPS and use the older system instead. Samba configuration is similar in either case, and if local printing is working to your satisfaction, leaving your current printing system in place is likely to be the less troublesome solution, so you may want to skip ahead to [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Creating a Printer Share|Section 4.3]]. If you want to switch to CUPS, you should uninstall your existing printing software, if it's installed. In an RPM-based distribution, the &amp;lt;tt&amp;gt;-e&amp;lt;/tt&amp;gt; parameter to ''rpm'' can uninstall the software: &amp;lt;tt&amp;gt;'''rpm'''&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;'''-e'''&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;'''lprng'''&amp;lt;/tt&amp;gt; uninstalls the ''lprng'' package, if that's what your system uses. In Debian or its derivatives, the &amp;lt;tt&amp;gt;-r&amp;lt;/tt&amp;gt; parameter to ''dpkg'' should do the job, as in &amp;lt;tt&amp;gt;'''dpkg'''&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;'''-r lprng'''&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once your system is shed of any printing system, the best way to install CUPS is to use a package for your distribution. These packages include SysV startup scripts designed for your distribution, as well as sample configuration files and perhaps patches. As with uninstalling programs, using your package system is usually the best approach. Some tools, such as Debian's ''apt-get'' and Gentoo's ''emerge'', work over the network; for instance, typing &amp;lt;tt&amp;gt;'''emerge'''&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;'''cups'''&amp;lt;/tt&amp;gt; on a Gentoo system downloads and installs CUPS. Other tools, such as ''rpm'' on an RPM-based system or Debian's ''dpkg'', require that you have a package file available locally. Frequently, these files are available on your installation CD-ROMs.&lt;br /&gt;
&lt;br /&gt;
If you're using an older distribution, or one of the rare modern ones that doesn't yet provide CUPS as at least an option, you can obtain the CUPS source code from its web page. You must then compile and install the software locally. Consult the CUPS documentation if you need help doing this.&lt;br /&gt;
&lt;br /&gt;
Linux printing, like the Unix printing systems before it, typically works on a PostScript model: printers are assumed to be PostScript printers, and programs that print generate PostScript files. (Some programs with simpler printing needs generate plain-text printing output, though.) Most printers sold today aren't PostScript models, though. For this reason, CUPS, like other printing tools, relies on Ghostscript (''http://www.cs.wisc.edu/~ghost/'') and related tools to convert PostScript into formats suitable for whatever printer you actually use. Frequently, installing CUPS automatically installs Ghostscript and perhaps a set of drivers and descriptions that CUPS uses to help pass data through Ghostscript. Particularly if you use a lower-level package management tool, you may need to install these tools manually before you can install CUPS; the package tool will complain about an unmet dependency if you haven't installed the appropriate prerequisites. In some cases, you may need to search for and manually install some driver files. One site that's likely to be helpful in this respect is the Linux Printing web site, ''http://www.linuxprinting.org/printer_list.cgi''. Enter your printer brand and model in the selection boxes, and then click the Show button to obtain a report on the printer's compatibility with Linux. This page may include links to special drivers for some particularly new and exotic models. In most cases, downloading the PostScript Printer Description (PPD) file is worthwhile; it's often not necessary, but when it is, you can quickly add it to your system's printer list.&lt;br /&gt;
&lt;br /&gt;
A basic CUPS installation knows how to handle generic PostScript printers and a few common non-PostScript models from a handful of manufacturers. If you begin following the options presented in the [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Adding Printers to CUPS|Section 4.2.2]] and can't locate your printer model, you may need to track down and install additional drivers and/or CUPS printer descriptions. These are available from several different sources:&lt;br /&gt;
&lt;br /&gt;
;Your distribution&lt;br /&gt;
: Most Linux distributions ship printer definitions in a package called ''cups-drivers'' or something similar. This package may just be a renamed version of one or more other printing packages.&lt;br /&gt;
;Foomatic&lt;br /&gt;
: The Linux Printing site provides a series of CUPS printer definitions at ''http://www.linuxprinting.org/foomatic.html''. The information for particular printers on the Linux Printing site is likely to point you to a Foomatic driver for the printer.&lt;br /&gt;
;GIMP Print&lt;br /&gt;
: The GNU Image Manipulation Program (GIMP) is a popular graphics package for Linux, and it's spawned a series of Ghostscript drivers and CUPS printer definitions that can be used even without the GIMP. Check ''http://gimp-print.sourceforge.net'' for more information on this package.&lt;br /&gt;
;ESP Print Pro&lt;br /&gt;
: Easy Software Products (ESP) developed CUPS and released it as open source software. ESP makes commercial printer definitions available, though; check ''http://www.easysw.com/printpro/'' for details.&lt;br /&gt;
&lt;br /&gt;
After you install one of these packages and restart the CUPS daemon, you should be able to select your printer by make and model in the CUPS configuration tools. In a few cases, though, you'll need to select a compatible model. For instance, many mid-range laser printers use the Printer Control Language (PCL) created by Hewlett-Packard (HP). Thus, you may be able to get a printer working by selecting an appropriate HP LaserJet model even if yours is another make. Consult your printer's documentation to learn if it's compatible with a more popular model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;sidebar&amp;quot;&amp;gt;&lt;br /&gt;
'''Printer Definition Files'''&lt;br /&gt;
&lt;br /&gt;
In the case of PostScript printers, you should be able to use a generic PostScript configuration. Pointing CUPS to a definition for your specific model can improve the ability of some Linux programs to use printer-specific features, such as duplexing or wide carriages. The printer definitions just described include appropriate files for many models. If you can find a PPD file (their filenames end in ppd or PPD) on a CD-ROM that shipped with the printer or on the printer manufacturer's web site, though, you can use it. CUPS PPD files reside in subdirectories of the ''/usr/share/ppd'' directory, so place the file in an appropriate subdirectory or create a new one. (Subdirectories are named for printer manufacturers.) The files should show up when you try to add a printer, as described shortly.&lt;br /&gt;
&lt;br /&gt;
Non-PostScript printers require PPD files with a few extra features, such as a &amp;lt;tt&amp;gt;*cupsFilter&amp;lt;/tt&amp;gt; line to specify the Ghostscript driver to be used. Thus, this approach is unlikely to work for non-PostScript printers, unless you can find a PPD file designed to use with CUPS and Ghostscript; that's what the printer description packages, such as Foomatic and GIMP Print, are designed to do. Some, but not all, ways of delivering drivers to Samba clients rely on the PPD files you install in CUPS, as described in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Delivering Printer Drivers to Windows Clients|Section 4.4]].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adding Printers to CUPS ===&lt;br /&gt;
&lt;br /&gt;
The simplest way to add printers to CUPS is to use the CUPS web-based administration tool. This tool runs on port 631 and is accessible by entering ''http://localhost:631'' in a web browser running on the computer you want to configure. (You may be able to use the hostname rather than ''localhost'', or even access a CUPS server from another computer on your network, depending on the CUPS security settings.) The result is a list of CUPS server options, such as Manage Printer Classes and Manage Jobs. Click the Manage Printers item to add, delete, or modify printer definitions. If this is the first time you've done this in your current session, you'll be asked for an administrative username and password. Type &amp;lt;tt&amp;gt;'''root'''&amp;lt;/tt&amp;gt; and the ''root'' password. The result should resemble [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#linuxwinworld-CHP-4-FIG-2|Figure 4-2]], although this figure shows a system with several printers already configured, and yours may show none set up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;linuxwinworld-CHP-4-FIG-2&amp;quot;&amp;gt;&lt;br /&gt;
'''Figure 4-2. CUPS provides a web-based tool for managing printers'''&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux in a Windows World_I_2_tt24.png|CUPS provides a web-based tool for managing printers]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
CUPS can be configured to refuse all web-based administration features. Configuring CUPS access controls is covered in the section [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Adjusting CUPS Browsing and Security|Section 4.2.3]], so check there if you can't get into the CUPS web-based interface.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add a local printer using the web-based interface, follow these steps from the printer administration screen shown in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#linuxwinworld-CHP-4-FIG-2|Figure 4-2]]:&lt;br /&gt;
&lt;br /&gt;
# Click the Add Printer button at the bottom of the printer list. (This button is below the edge of the page shown in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#linuxwinworld-CHP-4-FIG-2|Figure 4-2]].)&lt;br /&gt;
# In the page that results, enter text for the name, location, and description of the printer. You'll use the name you enter to refer to the printer, so make it short and descriptive, such as ''hp4000'' if your network has just one HP 4000 printer. The location and description fields provide additional information for you and your users, so you can enter anything you like for them. When you're done, click Continue.&lt;br /&gt;
# CUPS now asks for the printer device—the hardware port to which it's connected. Chances are you'll select a parallel or USB port. You can also select various network printer options, should you want to configure a Linux system to use a remote printer queue. For this description, I assume you're configuring a parallel printer; some options (particularly for network printers) deviate somewhat from this description. In particular, you must enter a network path for a network printer device, such as ''lpd://server/queue'' for an LPD printer. Click Continue when you're done.&lt;br /&gt;
# CUPS presents you with a list of printer makes. If you've installed Foomatic, GIMP Print, or some other printer description package, this list will be fairly long, and chances are your make will be available. If not, either install additional packages and restart the CUPS daemon or select a compatible make, such as HP or HEWLETT-PACKARD if you're using a PCL printer. Click Continue when you're done.&lt;br /&gt;
# CUPS presents you with a list of printer models. Select yours. Sometimes you may need to pick between two drivers for a single model. You can pick the one that's flagged as being recommended, configure two queues so you can try both, or consult a source such as the Linux Printing web site for advice. If you don't see your model, either pick a compatible one or use your browser's back button to look for an alternate spelling for your printer make. When you've selected a model, click Continue.&lt;br /&gt;
# CUPS should respond that the printer has been added. You can then click its name to bring up a control panel for the printer. [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#linuxwinworld-CHP-4-FIG-2|Figure 4-2]] shows these options for three printers.&lt;br /&gt;
# Click Print Test Page to test the printer's functionality. After a brief delay, the printer should spring into action and print a test page.&lt;br /&gt;
&lt;br /&gt;
Of course, the CUPS web interface, like other Linux GUI administration tools, works by modifying text files. In the case of CUPS, most configuration files reside in ''/etc/cups'' and its subdirectories. In particular, the file ''printers.conf'' defines the actual printers. If you prefer to directly modify the configuration file yourself, you can do so by editing this file. Printer definitions begin with the string &amp;lt;tt&amp;gt;Printer&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;DefaultPrinter&amp;lt;/tt&amp;gt; (the latter is for the default printer; there should be only one of these) followed by the printer name and enclosed in angle brackets (&amp;lt;tt&amp;gt;&amp;lt;&amp;gt;&amp;lt;/tt&amp;gt;). Subsequent lines set the options entered in the web-based tool; each begins with a keyword and continues with a string of some sort. A few options, such as &amp;lt;tt&amp;gt;State&amp;lt;/tt&amp;gt;, are adjusted by CUPS as it operates. An example entry looks like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;DefaultPrinter hp4000&amp;gt;&lt;br /&gt;
 Info Hewlett-Packard HP LaserJet 4000 Series&lt;br /&gt;
 Location Parallel printer on /dev/lp1&lt;br /&gt;
 DeviceURI parallel:/dev/lp1&lt;br /&gt;
 State Idle&lt;br /&gt;
 Accepting Yes&lt;br /&gt;
 JobSheets none none&lt;br /&gt;
 QuotaPeriod 0&lt;br /&gt;
 PageLimit 0&lt;br /&gt;
 KLimit 0&lt;br /&gt;
 &amp;lt;/Printer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As a general rule, it's easiest to create printer definitions using the CUPS web-based tool. Directly editing the ''printers.conf'' file can be tricky because you must know the syntax for all of the options, as well as option names. Directly editing the file can be a handy way to quickly make a change, though, such as changing the default printer.&lt;br /&gt;
&lt;br /&gt;
=== Adjusting CUPS Browsing and Security ===&lt;br /&gt;
&lt;br /&gt;
In addition to ''printers.conf'', another CUPS configuration file is critically important: ''cupsd.conf'' . This file, which also resides in ''/etc/cups'', controls overall server operations, including security features and ''browsing''. In the context of CUPS, browsing refers to the automatic discovery of printers that are shared via the Internet Printing Protocol (IPP), the printing protocol used by CUPS for CUPS-to-CUPS printer sharing. One of the main advantages of CUPS over earlier Linux printing systems is that CUPS supports browsing. This fact can greatly simplify printer configuration on Linux clients: just ensure that the server and client support browsing, and the client will automatically detect remote printers and add them to its printer list. If you subsequently add a printer to a CUPS server, you won't need to touch the clients; they'll detect the new printers within a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
To enable browsing on a CUPS server, open ''cupsd.conf'' in a text editor, and look for the &amp;lt;tt&amp;gt;Browsing&amp;lt;/tt&amp;gt; line, which will probably be about half-way through the file:&lt;br /&gt;
&lt;br /&gt;
 Browsing On&lt;br /&gt;
&lt;br /&gt;
The default value for this option is &amp;lt;tt&amp;gt;On&amp;lt;/tt&amp;gt;, meaning that browsing is enabled. Some distributions set this parameter to &amp;lt;tt&amp;gt;Off&amp;lt;/tt&amp;gt;, though, presumably as a security precaution. If you want a server to announce its printers to other computers, be sure that &amp;lt;tt&amp;gt;Browsing&amp;lt;/tt&amp;gt; is set to &amp;lt;tt&amp;gt;On&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
After you make a change to the CUPS configuration file and restart the CUPS daemon, it may take several seconds for clients to see the new printers.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may also want to adjust the &amp;lt;tt&amp;gt;BrowseAddress&amp;lt;/tt&amp;gt; lines, which appear shortly after the &amp;lt;tt&amp;gt;Browsing&amp;lt;/tt&amp;gt; option. This parameter specifies the network addresses to which browse lists should be broadcast. On a small LAN, a value of &amp;lt;tt&amp;gt;@LOCAL&amp;lt;/tt&amp;gt; should do well. This option tells CUPS to broadcast browse lists to its local network interfaces. You can also specify network blocks using broadcast IP addresses, as in 192.168.17.255 to send broadcasts to the 192.168.17.0/24 network. In fact, you can include several &amp;lt;tt&amp;gt;BrowseAddress&amp;lt;/tt&amp;gt; lines to specify multiple networks:&lt;br /&gt;
&lt;br /&gt;
 BrowseAddress @LOCAL&lt;br /&gt;
 BrowseAddress 192.168.17.255&lt;br /&gt;
&lt;br /&gt;
On the client side, the &amp;lt;tt&amp;gt;BrowseAllow&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;BrowseDeny&amp;lt;/tt&amp;gt; options specify addresses from which browse packets should or should not be accepted. You can set these options as DNS hostnames, as domain names preceded by dots (as in ''.example.com''), as IP addresses, as IP address/netmask pairs, or in various other forms. You can also use the same &amp;lt;tt&amp;gt;@LOCAL&amp;lt;/tt&amp;gt; notation accepted by &amp;lt;tt&amp;gt;BrowseAddress&amp;lt;/tt&amp;gt;. Typically, you'll set a CUPS client to accept browse packets from your local network, and perhaps from some others:&lt;br /&gt;
&lt;br /&gt;
 BrowseAllow @LOCAL&lt;br /&gt;
 BrowseAllow 192.168.17.0/24&lt;br /&gt;
&lt;br /&gt;
The default for &amp;lt;tt&amp;gt;BrowseAllow&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;All&amp;lt;/tt&amp;gt;, which accepts all browse packets. This configuration is appropriate for CUPS clients on small LANs, but if you're configuring a system on a larger network, you may want to restrict the remote printers it adds by explicitly setting &amp;lt;tt&amp;gt;BrowseAllow&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Most of the options in ''cupsd.conf'' are global; they apply to the CUPS configuration as a whole. CUPS also supports more fine-grained control in sections that are delimited by &amp;lt;tt&amp;gt;Location&amp;lt;/tt&amp;gt; directives. These begin with the keyword &amp;lt;tt&amp;gt;Location&amp;lt;/tt&amp;gt; and a location name, surrounded by angle brackets (&amp;lt;tt&amp;gt;&amp;lt;&amp;gt;&amp;lt;/tt&amp;gt;), and end with &amp;lt;tt&amp;gt;&amp;lt;/Location&amp;gt;&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Location /printers&amp;gt;&lt;br /&gt;
 Order Deny,Allow&lt;br /&gt;
 Deny From All&lt;br /&gt;
 Allow from 127.0.0.1&lt;br /&gt;
 Allow from 192.168.1.0/24&lt;br /&gt;
 Allow from 172.24.21.0/24&lt;br /&gt;
 Allow From @LOCAL&lt;br /&gt;
 &amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example uses the &amp;lt;tt&amp;gt;Allow&amp;lt;/tt&amp;gt; directive to tell CUPS to grant access to the specified computers and networks. This example also controls access to the &amp;lt;tt&amp;gt;/printers&amp;lt;/tt&amp;gt; location, which, as you might expect, provides the means to access printers. Other locations of interest include the root (&amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;), which sets the default security policy; &amp;lt;tt&amp;gt;/jobs&amp;lt;/tt&amp;gt;, which controls the ability to adjust job priorities, delete jobs, and so on; and &amp;lt;tt&amp;gt;/admin&amp;lt;/tt&amp;gt;, which controls administrative functions such as adding new printers. This last section frequently includes &amp;lt;tt&amp;gt;AuthType&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;AuthClass&amp;lt;/tt&amp;gt; options, which tell CUPS to require authentication; after all, you don't want to let just anybody access the printer administration tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
If you can't access the CUPS administration web page, try examining the &amp;lt;tt&amp;gt;/admin&amp;lt;/tt&amp;gt; location. Be sure that an &amp;lt;tt&amp;gt;Allow&amp;lt;/tt&amp;gt; line grants access to the computer used to access the server. Frequently, this is set to &amp;lt;tt&amp;gt;127.0.0.1&amp;lt;/tt&amp;gt;, for localhost access only, but you can add more lines to grant access to other computers. I recommend doing so with caution, though; granting other computers access to a CUPS server is a potential security risk.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating a Printer Share ==&lt;br /&gt;
&lt;br /&gt;
Now that you've got printers working on the Samba server using CUPS or some other printing software, it's time to begin configuring a printer share in Samba itself. Printer shares are very much like file shares, so you can configure printer shares much as you would configure file shares, but with a few key differences. You'll also need to decide whether to share a non-PostScript printer as a PostScript model (using Ghostscript to convert PostScript into the printer's native format) or using native drivers on the clients (bypassing Ghostscript on the server).&lt;br /&gt;
&lt;br /&gt;
=== File Shares Versus Printer Shares ===&lt;br /&gt;
&lt;br /&gt;
SMB/CIFS printer shares are virtually identical to file shares from a Samba configuration perspective. The difference is what the server does with files sent to the share by clients. In the case of file shares, the files are stored in a local directory and then ignored—at least, until they're accessed by the same or another client. In the case of printer shares, though, the server stores the file and then passes that file to the local printing system. The printing system typically prints the file and then deletes it. (Samba supports specifying an arbitrary command as the printing system, though, so you can use &amp;quot;printer&amp;quot; shares to perform unusual tasks, such as creating a CD-R.)&lt;br /&gt;
&lt;br /&gt;
Because SMB/CIFS printer shares are so similar to file shares, they're defined just as you would define a file share, by placing the share name in square brackets, as in &amp;lt;tt&amp;gt;[okidata]&amp;lt;/tt&amp;gt; to create a printer share called ''OKIDATA''. In order to create a printer share, though, you must set one or more additional parameters:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;printable&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level Boolean parameter, when set to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt; (the default is &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt;), defines a printer share; it alone will create a printer share, although it might not work, depending on other parameters and the overall computer configuration. This parameter overrides the &amp;lt;tt&amp;gt;writeable&amp;lt;/tt&amp;gt; parameter and its synonyms; all printable shares are necessarily read/write. A synonym for this parameter is &amp;lt;tt&amp;gt;print ok&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;printing&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This parameter sets the printing system that Linux uses. Samba supports 11 values (&amp;lt;tt&amp;gt;BSD&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;AIX&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;LPRng&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;PLP&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;SysV&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;HPUX&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;QNX&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;SoftQ&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;CUPS&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;OS2&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;NT&amp;lt;/tt&amp;gt;), but only &amp;lt;tt&amp;gt;BSD&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;LPRng&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;CUPS&amp;lt;/tt&amp;gt; are common in Linux. (The &amp;lt;tt&amp;gt;SoftQ&amp;lt;/tt&amp;gt; option was removed early in the 3.0.x series, while &amp;lt;tt&amp;gt;OS2&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;NT&amp;lt;/tt&amp;gt; are recent additions.) This parameter sets the defaults for several other parameters, enabling Samba to most efficiently submit print jobs to your local print queues. Until Samba 3.0.3, this parameter was global, but it's a now a share-level parameter.&lt;br /&gt;
;&amp;lt;tt&amp;gt;print command&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This share-level parameter sets the command that's used to print a file. The default depends on the &amp;lt;tt&amp;gt;printing&amp;lt;/tt&amp;gt; parameter. You can tweak this option to achieve special effects, such as setting duplex printing. If you try changing this parameter, be sure that the command you specify deletes the input file (identified by the Samba &amp;lt;tt&amp;gt;%s&amp;lt;/tt&amp;gt; variable).&lt;br /&gt;
;&amp;lt;tt&amp;gt;printer name&amp;lt;/tt&amp;gt;&lt;br /&gt;
: You can specify the name of the local print queue with this parameter. If you omit it, the default is based on the share name; for instance, if the share is called ''OKIDATA'', Samba will try to submit the job to a queue called ''okidata''. One important exception is described shortly. This option actually sets the &amp;lt;tt&amp;gt;%p&amp;lt;/tt&amp;gt; variable, which specifies the print queue in the &amp;lt;tt&amp;gt;print command&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;printcap name&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This parameter points Samba at a file that defines local printers. It's important only if you define a &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share, as described shortly. Ordinarily, this parameter points to ''/etc/printcap'', but if you set &amp;lt;tt&amp;gt;printing = CUPS&amp;lt;/tt&amp;gt;, you can also set &amp;lt;tt&amp;gt;printcap&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;name = CUPS&amp;lt;/tt&amp;gt; to have Samba use the CUPS API to obtain a printer list. This requires CUPS support in the Samba binary, which may be added or omitted as a compile-time option. If this support is missing, you may still use &amp;lt;tt&amp;gt;printing&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;CUPS&amp;lt;/tt&amp;gt;, but Samba won't use the CUPS API, and you may need to set &amp;lt;tt&amp;gt;printcap name = /etc/printcap&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;load printers&amp;lt;/tt&amp;gt;&lt;br /&gt;
: This global Boolean parameter tells Samba whether to load the printers specified in &amp;lt;tt&amp;gt;printcap name&amp;lt;/tt&amp;gt; for browsing. This parameter defaults to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, and if you intend to use a &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share, you shouldn't change it.&lt;br /&gt;
;&amp;lt;tt&amp;gt;min print space&amp;lt;/tt&amp;gt;&lt;br /&gt;
: To minimize the risk of problems due to insufficient disk space, you can specify a minimum that must be present before Samba will accept a print job. This parameter takes disk space in kilobytes; if less space is free in the target directory, Samba will refuse the print job. The default value is &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;, which disables this check.&lt;br /&gt;
&lt;br /&gt;
Several other options are available to tweak features, such as the commands used to delete print jobs, pause the print queue, and so on. Consult the ''smb.conf'' manpage for details. In addition, some common file share parameters are important. Most notable of these is &amp;lt;tt&amp;gt;directory&amp;lt;/tt&amp;gt; or its synonym, &amp;lt;tt&amp;gt;path&amp;lt;/tt&amp;gt;. These parameters tell Samba where to store the print job before it's submitted to the print queue. The default value of &amp;lt;tt&amp;gt;/tmp&amp;lt;/tt&amp;gt; usually works, but you may want to change this to a Samba-specific directory, such as &amp;lt;tt&amp;gt;/var/spool/samba&amp;lt;/tt&amp;gt;. You should ''not'' try pointing Samba to your CUPS, LPRng, or other local printing system's queue! If you create a new Samba printer queue directory, be sure it's readable to all users who are authorized to use the printer. You may also want to set the ''sticky bit'' on the directory, which will prevent users other than the files' owners from deleting a file:&lt;br /&gt;
&lt;br /&gt;
 # '''mkdir /var/spool/samba'''&lt;br /&gt;
 # '''chmod 777 /var/spool/samba'''&lt;br /&gt;
 # '''chmod o+t /var/spool/samba'''&lt;br /&gt;
                &lt;br /&gt;
&lt;br /&gt;
One unusual printer share is defined as &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt;. If this share is present, Samba creates individual shares for all of the shares in ''/etc/printcap'' (or another file specified by &amp;lt;tt&amp;gt;printcap name&amp;lt;/tt&amp;gt;). Using a &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share can greatly simplify printer configuration, particularly on a server with many printers you want to share. This share is described in more detail in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#The [printers] Share|Section 4.5.4]].&lt;br /&gt;
&lt;br /&gt;
=== Sharing PostScript Printers ===&lt;br /&gt;
&lt;br /&gt;
In Linux's native printing system, most programs treat printers as PostScript models. Part of the job of CUPS (or any other Linux printing queue) is to pass PostScript files through Ghostscript to convert them into formats that the printer can actually understand. (Of course, if the printer is a PostScript model, this conversion process isn't necessary when programs generate PostScript output.) From a purely Linux point of view, Samba is just another program; the fact that the files Samba prints originate from another computer is unimportant.&lt;br /&gt;
&lt;br /&gt;
The result of this arrangement is that sharing a printer as a PostScript printer is usually fairly straightforward. If you can print from the Samba server computer itself using commands like ''lpr'' or the CUPS test page printout, you can share a printer with a fairly basic ''smb.conf'' entry:&lt;br /&gt;
&lt;br /&gt;
 [epson]&lt;br /&gt;
    directory = /var/spool/samba&lt;br /&gt;
    printable = Yes&lt;br /&gt;
&lt;br /&gt;
This entry makes a printer share called ''EPSON'' available to clients. On the clients, you must use a PostScript driver to print to the printer, whether or not the printer is really a PostScript model; to the client, it ''looks like'' a PostScript printer. (Windows printer drivers are described in more detail in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Delivering Printer Drivers to Windows Clients|Section 4.4]].)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
Some Windows PostScript drivers generate output that can confuse a normal Linux queue into thinking the file is not, in fact, PostScript. If your Windows printouts to genuine PostScript printers consist of PostScript code rather than the documents you intended, one workaround is to use a raw queue like the one described in the [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Sharing Non-PostScript Printers|Section 4.3.3]], on the Samba server.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sharing printers as PostScript models means that print jobs are sent over the network as PostScript. In the case of text documents, this is generally fairly efficient because the content is mostly text, rather than text converted to bitmaps. Using PostScript can also simplify driver installation and maintenance on a network with many printers; you may be able to use just one driver for several different printers. On the other hand, if the printer isn't really a PostScript model, the Samba server computer will need to convert the text into some other form (usually a printer-specific bitmap), which can consume a fair amount of CPU time on the server.&lt;br /&gt;
&lt;br /&gt;
=== Sharing Non-PostScript Printers ===&lt;br /&gt;
&lt;br /&gt;
When sharing a non-PostScript printer, another option is available: you can share the printer using a &amp;quot;raw&amp;quot; Linux printer queue. This queue uses the local Linux printing system, such as CUPS, but it bypasses Ghostscript. The result is that programs, such as Samba and its clients, must produce files the printer can parse. Typically, you do this by installing and using a printer's native drivers, as supplied by the manufacturer, on the Windows clients.&lt;br /&gt;
&lt;br /&gt;
The Samba printer share configuration for a non-PostScript printer is likely to look much like the configuration for a PostScript printer. The main difference on the Samba server side is in the Linux printer queue configuration. In the case of CUPS, when you provide CUPS with the printer's make (in Step #4 of the procedure in the [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Adding Printers to CUPS|Section 4.2.2]]), you select Raw, followed by Raw Queue as the model. Alternatively, in Samba 3.0.3 and later, you can use the Samba &amp;lt;tt&amp;gt;cups options = raw&amp;lt;/tt&amp;gt; parameter if you set &amp;lt;tt&amp;gt;printing = CUPS&amp;lt;/tt&amp;gt;. This option tells CUPS to handle the input as if it were to a raw queue. If you're using LPRng or BSD LPD, omit the &amp;lt;tt&amp;gt;if&amp;lt;/tt&amp;gt; line in ''/etc/printcap'' to create a raw queue.&lt;br /&gt;
&lt;br /&gt;
When sharing printers in this way, the client generates printer-specific codes. For many low-end printers, this means that the clients generate bitmaps, even when printing text. These bitmaps are likely to be larger than PostScript files describing the same page, so raw printer queues may increase the network bandwidth requirements of printing. On the other hand, because Ghostscript isn't involved on the print server, the CPU requirements on the server are likely to be reduced. Non-PostScript Windows printer drivers are also likely to provide access to printer features that aren't easily adjusted through PostScript drivers, such as a printer's resolution.&lt;br /&gt;
&lt;br /&gt;
When deciding between PostScript and raw queues, your best bet is to set up both types of queue and evaluate performance yourself. Try printing some documents in both ways and judge the output quality, print speed, and network load. You can then decide which method to use when you make the printers available to all your users. In some cases, you may want to make a printer accessible in both ways. This will enable your users to pick the optimum driver—say, to use a PostScript driver when printing text but to use a printer-specific driver when printing graphics.&lt;br /&gt;
&lt;br /&gt;
== Delivering Printer Drivers to Windows Clients ==&lt;br /&gt;
&lt;br /&gt;
One critically important part of Samba printer configuration is distributing drivers to Windows clients. This task can be accomplished in several different ways. One approach that requires little explanation is to use the driver CD-ROM that came with the printer (or a generic PostScript driver for Ghostscript-driven printers) to install the driver on all the clients. This approach is simple enough on a small network, but it becomes awkward when many clients are involved. For these cases, SMB/CIFS provides mechanisms to help deliver drivers to many clients, and Samba supports these mechanisms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Warning'''&lt;br /&gt;
&lt;br /&gt;
If you fail to configure Linux to deliver a Windows printer driver, Windows NT/200x/XP clients may display spurious &amp;quot;unable to connect&amp;quot; error messages. To avoid this problem, set &amp;lt;tt&amp;gt;use&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;client&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;driver&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;. However, you should ''not'' use this option if you configure Linux to deliver printer drivers to Windows NT/200x/XP clients.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can take a middle ground. Instead of using the semiautomated driver installation mechanisms described here, you can create an ordinary file share that holds the printer drivers. You can then install the drivers from that share on all the clients. This procedure obviates the need to carry a CD-ROM around from one computer to another, or to keep track of the CD-ROM for the benefit of computers you add after setting up the printer.&lt;br /&gt;
&lt;br /&gt;
=== Picking a Driver ===&lt;br /&gt;
&lt;br /&gt;
The first task you must undertake in driver installation is to select the drivers you want to install. To a large extent, this decision depends on whether you share the printer using a PostScript queue or a raw queue. (This difference is moot, of course, in the case of PostScript printers.) In many cases, though, you can choose between drivers from more than one source:&lt;br /&gt;
&lt;br /&gt;
;OS drivers&lt;br /&gt;
: Windows (and most other operating systems) ship with an array of printer drivers. You may be able to select a driver from among those that ship with the OS. This is true for both PostScript and non-PostScript drivers.&lt;br /&gt;
;Printer manufacturer drivers&lt;br /&gt;
: Printer manufacturers invariably ship Windows drivers with their printers. For older printers, you may need to check the manufacturer's web site to obtain drivers that can work with more recent versions of Windows.&lt;br /&gt;
;Adobe's PostScript drivers&lt;br /&gt;
: Adobe makes drivers for PostScript printers available from its downloads page (''http://www.adobe.com/support/downloads/)''. These drivers are generic PostScript drivers that require PPD files to operate. (Adobe makes these available for printers with Adobe interpreters, as well.) They're also licensed only for printers that use PostScript interpreters written by Adobe.&lt;br /&gt;
;The CUPS PostScript driver&lt;br /&gt;
: A Windows PostScript driver is associated with the CUPS project. Because you can install this driver from the Samba server computer without the help of a Windows system, it's particularly simple to install, as described in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Installing drivers from Linux|Section 4.4.3.1]]. The CUPS driver works only on Windows NT/200x/XP systems, however; if you need to deliver drivers to Windows 9x/Me systems, you'll need another driver source, at least for those clients.&lt;br /&gt;
&lt;br /&gt;
Because of the array of printers available today, I can't make a blanket recommendation for what driver to use; any of the preceding classes of drivers might work well. In fact, chances are any of them will work well with most printers, with the exception of PostScript drivers if you already know you want to share a non-PostScript printer raw.&lt;br /&gt;
&lt;br /&gt;
=== Defining Necessary Shares ===&lt;br /&gt;
&lt;br /&gt;
Samba 2.2 and later use a special file share to deliver printer drivers. This share is defined as &amp;lt;tt&amp;gt;[print$]&amp;lt;/tt&amp;gt;. Ultimately, printer driver files will reside in this share, but for the moment you must simply create it. A typical &amp;lt;tt&amp;gt;[print$]&amp;lt;/tt&amp;gt; share looks like this:&lt;br /&gt;
&lt;br /&gt;
 [print$]&lt;br /&gt;
    comment = Printer Driver Storage&lt;br /&gt;
    directory = /usr/share/samba/drivers&lt;br /&gt;
    browseable = No&lt;br /&gt;
    read only = Yes&lt;br /&gt;
    write list = gutenberg&lt;br /&gt;
&lt;br /&gt;
The location of the shared directory is somewhat arbitrary, but the key point is that it must exist. This directory must also be readable to all those who might want to add printers to their machines. You'll typically give one or more users write access to the share (&amp;lt;tt&amp;gt;gutenberg&amp;lt;/tt&amp;gt; in this example). These users are the printer administrators; they're authorized to add printer drivers to the share. Be sure that the printer administrators have Linux write privileges to the location you've chosen as the &amp;lt;tt&amp;gt;PRINT$&amp;lt;/tt&amp;gt; share directory. You should also list these users on the &amp;lt;tt&amp;gt;printer&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;admin&amp;lt;/tt&amp;gt; line in the &amp;lt;tt&amp;gt;[global]&amp;lt;/tt&amp;gt; section of ''smb.conf'':&lt;br /&gt;
&lt;br /&gt;
 printer admin = gutenberg&lt;br /&gt;
&lt;br /&gt;
Before adding drivers, you must also define some printer shares. If you want to share all the printers on the server, a &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share, as described in the section [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#The [printers] Share|Section 4.5.4]], should do nicely.&lt;br /&gt;
&lt;br /&gt;
 [printers]&lt;br /&gt;
    comment = All Printers&lt;br /&gt;
    path = /var/spool/samba&lt;br /&gt;
    printable = Yes&lt;br /&gt;
&lt;br /&gt;
After you make these changes to ''smb.conf'', you must either wait a minute or two for Samba to discover and implement the changes or force Samba to restart or reload its configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
Samba stores printer driver files in the ''PRINT$'' share, but it stores information about these files in Trivial Data Base (TDB) files located elsewhere—typically in ''/var/cache/samba'' and ''/var/cache/samba/printing''. In theory, you can edit these files with the help of Samba's ''rpcclient'' command, but unless you're an expert with this tool, doing so is extremely tedious. In case of errors when installing printer drivers, you may need to delete these files and start from scratch.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the Driver on the Server ===&lt;br /&gt;
&lt;br /&gt;
Once you've reconfigured Samba with the &amp;lt;tt&amp;gt;PRINT$&amp;lt;/tt&amp;gt; share and one or more printer shares, you can install Windows printer drivers in Samba. You can perform this task from the Samba server, from another Linux or Unix system, or from a Windows client. The CUPS driver can only be installed from a Linux or Unix system, the Adobe PostScript driver can be installed in either way, and most other drivers can be most easily installed from a Windows client.&lt;br /&gt;
&lt;br /&gt;
==== Installing drivers from Linux ====&lt;br /&gt;
&lt;br /&gt;
CUPS ships with a program, called ''cupsaddsmb'' , which can install Windows printer drivers on a Samba server computer. This command's syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 cupsaddsmb [-H ''samba-server''] [-U ''samba-user''] [-h ''cups-server''] [-v] &lt;br /&gt;
     {-a | ''printer-list''}&lt;br /&gt;
&lt;br /&gt;
In the simplest case, you can type &amp;lt;tt&amp;gt;'''cupsaddsmb'''&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;'''-a'''&amp;lt;/tt&amp;gt; on the server system as the printer administrator. The system defaults to installing the CUPS drivers from ''localhost'' to ''localhost''. The &amp;lt;tt&amp;gt;-a&amp;lt;/tt&amp;gt; parameter tells the program to add drivers for all available CUPS printers. If you don't share all these printers, you must specify them individually. The &amp;lt;tt&amp;gt;-v&amp;lt;/tt&amp;gt; parameter increases the verbosity of the program's output, which can be handy for debugging problems.&lt;br /&gt;
&lt;br /&gt;
Of course, ''cupsaddsmb'' can't conjure printer drivers out of thin air; you must place them somewhere the program can find them ''before'' executing the program. By default, ''cupsaddsmb'' looks for drivers in ''/usr/share/cups/drivers''. These drivers can come from one of two sources:&lt;br /&gt;
&lt;br /&gt;
;The CUPS PostScript drivers for Windows&lt;br /&gt;
: These drivers can be found at ''http://www.cups.org/windows.php''. The CUPS documentation recommends using them. As of CUPS 1.1.20, though, these drivers support only Windows NT/200x/XP.&lt;br /&gt;
;The Adobe PostScript drivers for Windows&lt;br /&gt;
: You can find Adobe's drivers at ''http://www.adobe.com/support/downloads/''. These drivers support Windows 9x/Me as well as NT/200x/XP.&lt;br /&gt;
&lt;br /&gt;
In either case, you must install driver files in ''/usr/share/cups/drivers'', but how you place them there depends on the driver. In the case of the CUPS drivers, you download a tarball from the CUPS web site, extract the tarball, and run the ''cups-samba.install'' script from the tarball. This script asks for confirmation and installs the files in ''/usr/share/cups/drivers''. You can then run ''cupsaddsmb'' to install the drivers on the Samba server.&lt;br /&gt;
&lt;br /&gt;
The Adobe drivers, on the other hand, were designed to be installed from a Windows system to a Windows system. They come in the form of a Windows executable (''.EXE'') file. This file is a self-extracting Microsoft Cabinet archive, which can be extracted in Linux using the ''cabextract'' program. (Check your distribution for this program, or visit ''http://freshmeat.net/projects/cabextract/'' to download the source code or a binary package.) When you extract the drivers file, you must copy several files into ''/usr/share/cups/drivers'', as detailed in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#linuxwinworld-CHP-4-TABLE-1|Table 4-1]]. Note that ''cupsaddsmb'' expects these files to appear in all-uppercase, but some of them are in lowercase or mixed case in the archive; you need to rename some of the files to change their case. Also, these files are scattered about in the ''Windows'' and ''WinNT'' subdirectories. In my experience, this option works well for Windows NT/200x/XP, but Windows 9x/Me tends to complain about a missing ''.INF'' file when installing the drivers installed in this way. If you run into this problem, you may need to install Windows 9x/Me drivers another way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;linuxwinworld-CHP-4-TABLE-1&amp;quot;&amp;gt;&lt;br /&gt;
'''Table 4-1. Adobe PostScript driver files'''&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Windows 9x/Me !! Windows NT/200x/XP&lt;br /&gt;
|-&lt;br /&gt;
| ADFONTS.MFM || ADOBEPS5.DLL&lt;br /&gt;
|-&lt;br /&gt;
| ADOBEPS4.DRV || ADOBEPSU.DLL&lt;br /&gt;
|-&lt;br /&gt;
| ADOBEPS4.HLP || ADOBEPSU.HLP&lt;br /&gt;
|-&lt;br /&gt;
| DEFPRTR2.PPD || -&lt;br /&gt;
|-&lt;br /&gt;
| ICONLIB.DLL || -&lt;br /&gt;
|-&lt;br /&gt;
| PSMON.DLL || -&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you've installed the CUPS or Adobe driver files, you can type &amp;lt;tt&amp;gt;'''cupsaddsmb'''&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;'''-a'''&amp;lt;/tt&amp;gt; or whatever variant you need to type, given your printer administration username and other variables. The program should ask for your password on the Samba server, copy the driver files, and configure the server to deliver the files to clients when they connect, as described in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Installing Drivers on Clients|Section 4.4.4]].&lt;br /&gt;
&lt;br /&gt;
Unfortunately, ''cupsaddsmb'' is rather delicate and sometimes doesn't work correctly. Likely problems include missing driver files, an attempt to install drivers without appropriate privileges on the server, and a mismatch of CUPS and Samba printer names (''cupsaddsmb'' assumes that these names match). If you have problems, check these items. You may also want to add the &amp;lt;tt&amp;gt;-v&amp;lt;/tt&amp;gt; parameter and check your Samba log files for clues to the cause of the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
Whenever possible, ''cupsaddsmb'' copies the PPD files used by CUPS as part of the driver installation. Both the CUPS and Adobe PostScript drivers for Windows use PPD files. It's possible, though, that the PPD file used by CUPS for Linux clients will not work well from Windows. If you suspect this is the problem, try replacing the PPD file on the Samba server and then re-install the driver on the clients. Look for a PPD file with your Windows PostScript driver package and copy it to the name and location in which Samba looks for the PPD file for that driver.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Installing drivers from Windows NT/200x/XP ====&lt;br /&gt;
&lt;br /&gt;
In theory, any Windows driver can be installed from Linux. The ''cupsaddsmb'' command merely copies files to the server and issues a few commands using the ''smbclient'' utility. You should be able to do the same for any printer driver files. In practice, though, the task is tedious without the help of ''cupsaddsmb'', and it only supports the CUPS and Adobe PostScript drivers. For this reason, you may want to install some drivers from Windows clients. (This task can be accomplished only from Windows NT/200x/XP clients; Windows 9x/Me doesn't support this operation.) Doing so employs the same facilities on the Samba server ''cupsaddsmb'' uses, but the Windows driver-installation tools use these features.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
Some drivers, particularly for older printers, come with installation programs that assume the printer will be connected locally or that don't support network installations. These drivers can be very difficult to install on a network print server. If you have such drivers and can't find more network-friendly updates, you may want to consider creating an ordinary Samba file share in which you can place the installer. You can then run the installer from each client that needs to use the printer.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When installing drivers from Windows, you must take one extra step on the Samba server computer. Windows printer drivers are installed in fixed directories on the Samba server's ''PRINT$'' share. You must create these directories and set their permissions so that the user adding the drivers can write to them. [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#linuxwinworld-CHP-4-TABLE-2|Table 4-2]] summarizes the directories you must add.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;linuxwinworld-CHP-4-TABLE-2&amp;quot;&amp;gt;&lt;br /&gt;
'''Table 4-2. Windows driver directories in PRINT$ share'''&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Client OS !! Directory name&lt;br /&gt;
|-&lt;br /&gt;
| Windows 9x/Me || ''win40''&lt;br /&gt;
|-&lt;br /&gt;
| Windows NT/200x/XP for x86 CPUs || ''w32x86''&lt;br /&gt;
|-&lt;br /&gt;
| Windows NT for Alpha CPUs || ''x32alpha''&lt;br /&gt;
|-&lt;br /&gt;
| Windows NT for MIPS CPUs || ''w32mips''&lt;br /&gt;
|-&lt;br /&gt;
| Windows NT for PowerPC CPUs || ''w32ppc''&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before proceeding, you should obtain the driver installation files. If you choose to use a driver that ships with Windows, you need only the Windows installation CD-ROM. Alternatively, you can download drivers from the printer manufacturer, from Adobe, or conceivably from some other source. Once you've obtained the drivers, follow these steps on the Windows computer to install drivers for the OS you're running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;In My Network Places, browse to the Samba server on which the share you want to install is located, and open the Printers and Faxes or Printers folder.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Right-click the printer you want to install and select Properties from the resulting pop-up menu. If no driver is installed, Windows asks if you want to install one.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Click No in response to the question about installing a driver. Clicking Yes will install a driver locally, not to the print server. Windows now displays a Properties dialog box.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Select the Advanced tab in the Properties dialog box.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Click the New Driver button in the Advanced tab of the Properties dialog box. Windows launches an Add Printer wizard to help guide you through the driver installation process.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Click Next in the Add Printer wizard's introductory screen. The result is a dialog box in which you can select the make and model of your printer from a list of standard Windows drivers, as shown in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#linuxwinworld-CHP-4-FIG-3|Figure 4-3]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;linuxwinworld-CHP-4-FIG-3&amp;quot;&amp;gt;&lt;br /&gt;
'''Figure 4-3. Windows ships with a large number of printer drivers'''&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux in a Windows World_I_2_tt36.png|Windows ships with a large number of printer drivers]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Select the driver for your printer from the list and click Next. Alternatively, click Have Disk to point the wizard at driver files you've obtained from another source.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
If you can't find your printer in the list and don't have a disk, try using the Apple LaserWriter IINT driver for monochrome PostScript printers or the QMS magicolor driver for color PostScript printers. These drivers are fairly generic and usually produce acceptable results.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;The Wizard informs you that you're about to add drivers. Click Finish to do so.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure adds drivers for the OS that the client you used to install them is running. If you want to add drivers for additional operating systems, follow these steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Open the Properties dialog box for the printer in question, if necessary.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Click the Sharing tab in the Properties dialogue box.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Click the Additional Drivers button in the Sharing tab. This action brings up an Additional Drivers dialog box, as shown in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#linuxwinworld-CHP-4-FIG-4|Figure 4-4]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;linuxwinworld-CHP-4-FIG-4&amp;quot;&amp;gt;&lt;br /&gt;
'''Figure 4-4. You can install drivers for additional Windows OSs'''&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux in a Windows World_I_2_tt37.png|You can install drivers for additional Windows OSs]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Check the box next to the Windows version for which you want to install drivers.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Click OK. Windows will ask for the location of the drivers.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Enter the path to the driver files or browse to them. The system will present a list of printers similar to that shown in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#linuxwinworld-CHP-4-FIG-3|Figure 4-3]].&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;div&amp;gt;Select the printer and click OK. Windows should install the drivers.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing Drivers on Clients ===&lt;br /&gt;
&lt;br /&gt;
Windows printer drivers, by their very nature, are Windows programs and so must be installed on Windows print clients. Installing them on a Samba server merely makes the drivers available for semiautomatic installation on Windows clients, thus obviating the need to keep track of driver installation CD-ROMs or files. Despite the fact that installing the drivers on the Samba server simplifies client driver installation, this task isn't wholly automatic, at least not when using SMB/CIFS printing. To install a driver on a Windows client, follow these steps:&lt;br /&gt;
&lt;br /&gt;
# Browse to the print server that hosts the printer you want to add to the computer. You should see an icon for the printer you want to add. If you don't, chances are the server is misconfigured.&lt;br /&gt;
# Double-click the icon corresponding to the printer you want to add. The result is a notice that you're about to connect to a printer and add a driver for it.&lt;br /&gt;
# Click Yes to continue the setup process. In some versions of Windows (most notably Windows 9x/Me), you'll be asked some additional questions, such as whether you intend to print to this printer from DOS programs.&lt;br /&gt;
&lt;br /&gt;
If all goes well, you'll see a dialog box summarizing the progress as the client transfers files from the server. An icon for the printer should then appear in your Printers or Printers and Faxes window, which you can open from the Control Panel. Windows 9x/Me asks if you want to print a test page during the install process. You should probably do so to test the printer's operation, particularly on the first client you install. If you skip this step during installation but want to do so afterwards, right-click the printer icon in the Printers or Printers and Faxes window and select Properties from the resulting menu. This action opens a Properties dialog box. Click Print Test Page from the General tab in this dialog box to print a test page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
Under Windows NT/200x/XP, one reason you may not be able to print is because the printer data in the Registry didn't get set correctly. You can set this data by setting the default page orientation in the printer control dialog box.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some Windows PostScript printer drivers generate PostScript that can confuse Linux printer queues into thinking the file is plain text. The result is a printout of PostScript commands, rather than the file you'd intended to print. If this happens, you can try several solutions.&lt;br /&gt;
&lt;br /&gt;
* Look for client-side options to disable a Ctrl-D before the print job. This character, if present, can be the cause of problems.&lt;br /&gt;
* Look for client-side options to disable printer mode-setting features. Some printer drivers generate special code to kick dual-language printers into PostScript mode, but this code can have the effect of confusing the Linux printer queue.&lt;br /&gt;
* Define a new raw printer queue on the Samba server and share the printer using that queue rather than the normal queue used from Linux.&lt;br /&gt;
* Change the driver used on the Windows client. If you've installed it in Samba, this action requires reinstalling the driver in Samba, which itself may require deleting TDB files.&lt;br /&gt;
&lt;br /&gt;
== Example Shares ==&lt;br /&gt;
&lt;br /&gt;
Knowing what the parameters are that control Samba share definitions and knowing how to use those parameters are two different things. Failing to see the forest for the trees, as it were, is easy to do when confronted with a list of Samba parameters. For this reason, this chapter concludes with a look at several common uses of Samba file and printer shares: the &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; share, which provides users with data storage space for their own files; a share that can store program files, templates, and other shared read-only files; shares for exchanging files between users; a closer look at the &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share introduced earlier; and a &amp;quot;printer&amp;quot; share that generates PDF files rather than paper printouts.&lt;br /&gt;
&lt;br /&gt;
=== The [homes] Share ===&lt;br /&gt;
&lt;br /&gt;
Many Samba server computers function, in whole or in part, as centralized storage locations for users' files. Users store their important files on the Samba server, enabling them to store more or larger files than would fit on their clients' disks and to move from one client to another and access their own home files. This strategy can also greatly simplify backup; if users' data files are on a single server, that server can be backed up more easily than can an entire network's worth of files, thus providing more reliable insurance in case of hardware failure.&lt;br /&gt;
&lt;br /&gt;
The user data storage function is so important that Samba provides a special share name just for this purpose: &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt;. This share functions much like an ordinary file share but with several important differences:&lt;br /&gt;
&lt;br /&gt;
* The share can be accessed via the user's username, as in ''LINNAEUS'' for the user ''linnaeus''. The share can also be accessed by the name ''HOMES'', but this name is usually considered secondary.&lt;br /&gt;
* In a Windows-dominated network, the username-based share name is typically what appears in network browsers. The ''HOMES'' name might not appear in browsers; this detail depends on configuration options, as described shortly.&lt;br /&gt;
* The default path for the share is the user's home directory, as specified in ''/etc/passwd'' or other account-definition files.&lt;br /&gt;
&lt;br /&gt;
A typical &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; share definition can be quite short:&lt;br /&gt;
&lt;br /&gt;
 [homes]&lt;br /&gt;
    comment = Home Directories&lt;br /&gt;
    writeable = Yes&lt;br /&gt;
    create mask = 644&lt;br /&gt;
    browseable = No&lt;br /&gt;
&lt;br /&gt;
The Samba default is to make shares read-only, but because the intended &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; shares enable users to store files that they create, changing this default is particularly important for these shares. The &amp;lt;tt&amp;gt;create&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;mask&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;644&amp;lt;/tt&amp;gt; parameter isn't necessary, and, in fact, it's undesirable if you want to preserve the archive bit on files. Using this parameter keeps the owner execute bit from being set, though, which may be desirable if users make heavy use of shell access or access via NFS or some other means that preserves this bit as such.&lt;br /&gt;
&lt;br /&gt;
Ordinarily, shares on which you set &amp;lt;tt&amp;gt;browseable&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;No&amp;lt;/tt&amp;gt; aren't visible in file browsers, but &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; shares are exceptions to this rule. Specifically, the &amp;lt;tt&amp;gt;browseable&amp;lt;/tt&amp;gt; parameter applies to the share called ''HOMES''; if you omit the &amp;lt;tt&amp;gt;browseable = No&amp;lt;/tt&amp;gt; parameter or set it to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;, a share called ''HOMES'' appears in clients' network browsers. Part of the definition of the &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; share is that a share named after the user who accesses the server appears in the user's browse lists. (''Only'' the home share for the user who accesses the server is displayed; users won't see other users' home shares, although they can be accessed by entering their names directly.)&lt;br /&gt;
&lt;br /&gt;
This example share doesn't specify a &amp;lt;tt&amp;gt;directory&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;path&amp;lt;/tt&amp;gt;; it relies on the &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; default. Although you can set a directory for the share, setting a static directory is usually undesirable. If you want to provide users with different home directories for remote text-mode or GUI logins than for Samba access, you can specify a Samba directory that is unique for each user by including variables such as &amp;lt;tt&amp;gt;%S&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;%u&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;%U&amp;lt;/tt&amp;gt;; these variables all expand to values related to the username. (In many cases, they expand to the same value.) For instance, you might set the &amp;lt;tt&amp;gt;path&amp;lt;/tt&amp;gt; like this:&lt;br /&gt;
&lt;br /&gt;
 path = /home/samba/%u&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
Some clients, such as the BeOS network browser, don't deliver a username until after they've retrieved lists of shares. For these network browsers, a &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; share will be invisible unless you set &amp;lt;tt&amp;gt;browseable =&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;. Such clients might also not work well if you use a &amp;lt;tt&amp;gt;%S&amp;lt;/tt&amp;gt; (share name) variable in a &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; share's &amp;lt;tt&amp;gt;path&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;directory&amp;lt;/tt&amp;gt; parameter.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many sample ''smb.conf'' files include &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; shares, so this share may already exist on your server. Of course, if you don't need it, you can delete it or change the definition to suit your particular needs.&lt;br /&gt;
&lt;br /&gt;
=== A Windows Program Share ===&lt;br /&gt;
&lt;br /&gt;
Samba servers can also be used as central repositories for files that many clients must access in a read-only manner—program executables, templates, clip art, fonts, and so on. Most users have no need to write to such shares, so most users receive read-only access. Somebody must maintain these shares, though, so a &amp;lt;tt&amp;gt;write&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt; parameter provides an exception to the rule:&lt;br /&gt;
&lt;br /&gt;
 [programs]&lt;br /&gt;
    comment = Program Files for All Users&lt;br /&gt;
    path = /usr/share/samba/windows-programs&lt;br /&gt;
    write list = linnaeus, mendel&lt;br /&gt;
    force user = linnaeus&lt;br /&gt;
    force group = users&lt;br /&gt;
    read only = Yes&lt;br /&gt;
    create mask = 660&lt;br /&gt;
    directory mask = 770&lt;br /&gt;
&lt;br /&gt;
In addition to the &amp;lt;tt&amp;gt;write&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt;, this example share includes &amp;lt;tt&amp;gt;force&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;user&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;force&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;group&amp;lt;/tt&amp;gt; parameters. These parameters force all files to be owned by a single user and group; even those files written by ''mendel'' will be owned by ''linnaeus'', which makes for a cleaner on-server set of ownerships; however, this also means you can't track whoever installed a particular file. These parameters also guarantee that all users will be able to read the files in the share, at least assuming that no files are written to the share through non-Samba means. Note that the &amp;lt;tt&amp;gt;force&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;user&amp;lt;/tt&amp;gt; parameter in conjunction with &amp;lt;tt&amp;gt;write&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt; does ''not'' give all users write access to the share; &amp;lt;tt&amp;gt;write&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt; applies to users' true logon usernames, not their identities as determined by &amp;lt;tt&amp;gt;force&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;user&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you create a share like this, be sure to set appropriate permissions on the share's directory (''/usr/share/samba/windows-programs'' in this example). If you don't give ''linnaeus'' write access to the directory, neither ''linnaeus'' nor ''mendel'' can store files in the share. You may also want to consider local Samba server security issues. For instance, if the share contains files that shouldn't be accessible to some non-Samba users of the server, you should set &amp;lt;tt&amp;gt;create mask&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;directory mask&amp;lt;/tt&amp;gt; parameters that deny world access (as in the example) and ensure that these users aren't in the group specified by &amp;lt;tt&amp;gt;force group&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== File-Exchange Shares ===&lt;br /&gt;
&lt;br /&gt;
A read-only share such as the &amp;lt;tt&amp;gt;[programs]&amp;lt;/tt&amp;gt; share is relatively straightforward to configure. A share that's used for data exchange between users is much more complex because you must decide how to set ownership and permissions that enable those who should be able to write to files to do so, while preventing those who shouldn't. Several approaches to solving this problem exist:&lt;br /&gt;
&lt;br /&gt;
;Shared access to [homes] directories&lt;br /&gt;
: You can set permissions on users' home directories such that they can read each others' files. If necessary, you can create local Linux groups and enable read access to group members while denying world access, thus providing support for groups of users. One drawback to this approach is that users will have to type in their collaborators' usernames when accessing shares; they won't be able to browse directly to those directories. (Creating symbolic links between users' home directories from Linux may provide a partial fix to this problem.)&lt;br /&gt;
;Multiple file exchange shares&lt;br /&gt;
: You can create several shares for file exchange, giving different groups access to different shares. You can use &amp;lt;tt&amp;gt;valid users&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;invalid users&amp;lt;/tt&amp;gt; to control access. Using Linux groups and permissions on files in shares also works to this end. Depending on your needs, using multiple sharing directories can be awkward because it clutters your list of shares if you need to create shares for many different groups&lt;br /&gt;
;One big happy file exchange share&lt;br /&gt;
: You can create a single share with lenient permissions—say, setting &amp;lt;tt&amp;gt;create&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;mask=666&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;directory mask=777&amp;lt;/tt&amp;gt; or using &amp;lt;tt&amp;gt;force user&amp;lt;/tt&amp;gt; to set ownership of all files to a single user. The effect is that all users can read and write all files in the share. This can be a good approach on servers on which you don't need to worry too much about keeping files from particular groups of local users. Even if that's the case, judicious use of such a share may be acceptable, but users will have to be warned against placing sensitive files on the data-exchange share.&lt;br /&gt;
;One big exchange share with internal security&lt;br /&gt;
: If you use the &amp;lt;tt&amp;gt;inherit&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;permissions&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt; parameter, you can use a single file-exchange share but maintain internal security by setting up subdirectories with different ownership and modes. For instance, one subdirectory might have 777 (&amp;lt;tt&amp;gt;rwxrwxrwx&amp;lt;/tt&amp;gt;) permissions, enabling anybody to read and write it, whereas another subdirectory might have 770 (&amp;lt;tt&amp;gt;rwxrwx---&amp;lt;/tt&amp;gt;) permissions, enabling members of its group to use it to exchange files while keeping it off-limits to other users. This approach is very flexible, but you need to give some thought to the local Linux permissions on the subdirectories. You also need to create these subdirectories from Linux. Users are likely to find this scheme confusing, but giving the subdirectories descriptive names, such as ''dna-analysis-group'' or ''instructors-only'', should help on that score.&lt;br /&gt;
&lt;br /&gt;
Precisely how you would configure such a share depends on which approach you take and on your Linux server's local security configuration. For one example, consider this file share:&lt;br /&gt;
&lt;br /&gt;
 [sanescientists]&lt;br /&gt;
    comment = Share for Use by Sane Scientists Only&lt;br /&gt;
    path = /usr/share/samba/sane&lt;br /&gt;
    valid users = @sane, linnaeus, mendel, curie&lt;br /&gt;
    writeable = Yes&lt;br /&gt;
    force group = sane&lt;br /&gt;
    create mask = 660&lt;br /&gt;
    directory mask = 770&lt;br /&gt;
 &lt;br /&gt;
 [madscientists]&lt;br /&gt;
    comment = Share for Use by Mad Scientists Only&lt;br /&gt;
    path = /usr/share/samba/mad&lt;br /&gt;
    valid users = @mad, morbius, moreau, frankenstein&lt;br /&gt;
    writeable = Yes&lt;br /&gt;
    force group = mad&lt;br /&gt;
    create mask = 660&lt;br /&gt;
    directory mask = 770&lt;br /&gt;
&lt;br /&gt;
These two shares, in combination, provide separate file-exchange areas for two groups of users. The first grants access to all members of the Linux ''sane'' group, plus three others who might or might not be members of that group. The second share does the same for the ''mad'' group and three other users. You can include a user in both groups if you like, in which case that user has access to both shares. For instance, you can place the user ''jekyl'' in both the ''sane'' and ''mad'' groups, or add the user explicitly to one or both shares' &amp;lt;tt&amp;gt;valid users&amp;lt;/tt&amp;gt; lines. If you want to give one group read-only access to another group's shares, add the members of both groups to the share's &amp;lt;tt&amp;gt;valid users&amp;lt;/tt&amp;gt; line but use &amp;lt;tt&amp;gt;read&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt; to restrict some users' access to the share.&lt;br /&gt;
&lt;br /&gt;
Another way to implement a similar system is to create a single share:&lt;br /&gt;
&lt;br /&gt;
 [scientists]&lt;br /&gt;
    comment = Share for Use by All Scientists&lt;br /&gt;
    path = /usr/share/samba/scientists&lt;br /&gt;
    valid users = @sane, @mad&lt;br /&gt;
    writeable = Yes&lt;br /&gt;
    inherit permissions = Yes&lt;br /&gt;
&lt;br /&gt;
You then create subdirectories within the share's directory with appropriate permissions set to enable only members of particular groups to access the directories. The result might look like this, as viewed using Linux's ''ls'':&lt;br /&gt;
&lt;br /&gt;
 # '''ls -l /usr/share/samba/scientists'''&lt;br /&gt;
 total 8&lt;br /&gt;
 drwxrwx---  2 root mad  4096 May  2 14:47 mad&lt;br /&gt;
 drwxrwx---  2 root sane 4096 May  2 14:47 sane&lt;br /&gt;
&lt;br /&gt;
The result is that members of the ''mad'' group can exchange files in the ''mad'' subdirectory, and members of the ''sane'' group can exchange files in the ''sane'' subdirectory. As configured, members of each group can't view the contents of or read files from the other group's subdirectory unless the individual is a member of both Linux groups. By changing permissions on the directories to 775 (&amp;lt;tt&amp;gt;rwxrwxr-x&amp;lt;/tt&amp;gt;) rather than 770 (&amp;lt;tt&amp;gt;rwxrwx---&amp;lt;/tt&amp;gt;), you can enable members of the groups to read but not write files in each others' directories. Because of the reliance on the local Linux groups, this scheme doesn't work well if some users aren't members of the underlying groups; this is the reason the individual users (''linnaeus'', ''morbius'', and so on) were omitted from the &amp;lt;tt&amp;gt;valid users&amp;lt;/tt&amp;gt; line in the share definition. You should also attend to ownership and permissions on the share directory itself; depending on its settings, users could create new subdirectories, which can complicate your security settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
Both examples omit the &amp;lt;tt&amp;gt;nt acl support&amp;lt;/tt&amp;gt; parameter, which defaults to &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt;. As a result, Windows NT/200x/XP users can set ACLs on their files, which will complicate access permissions. Of course, these ACLs won't help users read files if the users can't read the shares or directories in which they're stored, but if users can read the directories, ACLs can broaden or restrict access to specific files, particularly if the underlying filesystem supports ACLs.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are just two examples of common-access file shares. Many variants and alternatives are possible, that use Samba's security features, Linux's security features, or an interaction of the two. As a general rule, it's best to start with a simple security system; trying to use too many sophisticated features can lead you into trouble if you forget an important consequence or interaction.&lt;br /&gt;
&lt;br /&gt;
=== The [printers] Share ===&lt;br /&gt;
&lt;br /&gt;
Most print servers use a single &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share to make all printers available. This share can consist of just a few lines, but it relies on a few global settings, and some of its implications deserve elaboration. First, before defining a &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share, be sure to set the following parameters in the &amp;lt;tt&amp;gt;[global]&amp;lt;/tt&amp;gt; section of ''smb.conf'':&lt;br /&gt;
&lt;br /&gt;
 printing = CUPS&lt;br /&gt;
 printcap name = CUPS&lt;br /&gt;
 load printers = Yes&lt;br /&gt;
 printer admin = ''gutenberg''&lt;br /&gt;
 guest ok = Yes&lt;br /&gt;
&lt;br /&gt;
In this example, the &amp;lt;tt&amp;gt;printing&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;printcap name&amp;lt;/tt&amp;gt; parameters are both set to &amp;lt;tt&amp;gt;CUPS&amp;lt;/tt&amp;gt;, which tells Samba to use CUPS for printing, including using CUPS' own API for determining what printers are available. Of course, if you use another printing system, you'll change these parameters appropriately—say, to &amp;lt;tt&amp;gt;printing&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;LPRng&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;printcap&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;/etc/printcap&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
Samba provides CUPS support as a compile-time option. If Samba wasn't compiled on a system with appropriate CUPS development libraries installed, or if CUPS support was explicitly disabled, Samba won't include the necessary tools to use the CUPS API. In this case, you can still use &amp;lt;tt&amp;gt;printing&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;CUPS&amp;lt;/tt&amp;gt; (Samba will use old-style printing commands rather than the CUPS API to submit print jobs). You may need to set &amp;lt;tt&amp;gt;printcap&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;/etc/printcap&amp;lt;/tt&amp;gt;, though. If Samba doesn't find your printers, try making this change. In fact, CUPS provides compatibility commands, so it should work even if you set &amp;lt;tt&amp;gt;printing&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;LPRng&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;printing&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;BSD&amp;lt;/tt&amp;gt;, or certain other values.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;load printers&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt; parameter tells Samba to read information on available local printers from the file pointed to by &amp;lt;tt&amp;gt;printcap name&amp;lt;/tt&amp;gt; (or, if &amp;lt;tt&amp;gt;printcap name&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;CUPS&amp;lt;/tt&amp;gt;, to read the data using the CUPS API). By itself, this doesn't do anything; only if you provide an explicit &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share does this parameter have any effect.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;printer admin&amp;lt;/tt&amp;gt; line is optional; it sets the Linux username of a printer administrator—a user whose accesses to printer shares are done as if by ''root''. This user should be able to delete others' print jobs and otherwise perform maintenance on the queues.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;guest&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;ok&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;=&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;Yes&amp;lt;/tt&amp;gt; parameter tells Samba to accept guest access to the printer shares. This can be handy if you don't want to maintain a user database on a dedicated print server, but you'll need to adjust the global &amp;lt;tt&amp;gt;map to guest&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;guest&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;account&amp;lt;/tt&amp;gt; parameters. Enabling guest access also opens the system to potential abuses, particularly if the server is accessible to the Internet at large. (Imagine coming in one morning to discover that a high-speed, high-capacity printer has printed its entire load of paper with completely black pages, wasting both paper and toner or ink.)&lt;br /&gt;
&lt;br /&gt;
Once you've set the global options, you can create a &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share. This share is likely to be fairly uninteresting on the surface:&lt;br /&gt;
&lt;br /&gt;
 [printers]&lt;br /&gt;
    comment = All Printers&lt;br /&gt;
    path = /var/spool/samba&lt;br /&gt;
    printable = Yes&lt;br /&gt;
&lt;br /&gt;
Once this share is defined, and Samba either detects the changes (which it should do after a few minutes) or is restarted, you should see printer shares corresponding to all of your local printers that appear in clients' network browsers. The shares won't be usable, though; you must first install printer drivers on the clients, as described in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Delivering Printer Drivers to Windows Clients|Section 4.4]].&lt;br /&gt;
&lt;br /&gt;
Using a &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share doesn't mean that you're restricted from creating other printer shares. You can do so in either of two ways:&lt;br /&gt;
&lt;br /&gt;
* You can create a separate printer share using a name that doesn't correspond to a print queue on the underlying Linux computer. This share will be presented to users in addition to the shares created by the &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share.&lt;br /&gt;
* You can create a printer share that uses the same name as one of the printer queues on the underlying Linux computer. This share will override the share of the same name created by the &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share.&lt;br /&gt;
&lt;br /&gt;
The shares generated by &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; may be PostScript printers, non-PostScript printers that appear to clients as PostScript printers because of the use of Ghostscript in the Linux printer queue, or non-PostScript printers with raw Linux printer queues for which native printer drivers are necessary on the clients. In fact, you can provide a mixture of share types; the &amp;lt;tt&amp;gt;[printers]&amp;lt;/tt&amp;gt; share simply doesn't care.&lt;br /&gt;
&lt;br /&gt;
=== A PDF-Generation Printer Share ===&lt;br /&gt;
&lt;br /&gt;
Samba printer shares can be unusually flexible. This flexibility is derived, in part, from the &amp;lt;tt&amp;gt;print&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;command&amp;lt;/tt&amp;gt; parameter, which enables you to bypass the usual print processing. In fact, you can do some extremely complex and unusual things with this parameter, but in this section I describe a use that's at least related to printing: creating Portable Document Format (PDF) files.&lt;br /&gt;
&lt;br /&gt;
Several tools exist to generate PDF files from various formats. One of these is almost certainly already installed on your Linux computer: Ghostscript. In addition to generating output in formats that can be printed by your printer, Ghostscript can generate several common file formats, such as Tagged Image File Format (TIFF), Portable Network Graphics (PNG), and PDF. To create a Samba share that generates a PDF file, you call Ghostscript (with appropriate parameters) as the &amp;lt;tt&amp;gt;print command&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 [makepdf]&lt;br /&gt;
    comment = Share to Make PDFs&lt;br /&gt;
    path = /var/spool/samba&lt;br /&gt;
    printable = Yes&lt;br /&gt;
    print command = gs -dNOPAUSE -dBATCH -q -sDEVICE=pdfwrite \&lt;br /&gt;
                    -sOutputFile=%H/%s.pdf; rm %s&lt;br /&gt;
&lt;br /&gt;
When the ''MAKEPDF'' share receives a PostScript file, it passes it through Ghostscript (''gs''), specifying various parameters to generate PDF output without prompts and saving the output as ''%H/%s.pdf''. Because &amp;lt;tt&amp;gt;%H&amp;lt;/tt&amp;gt; is the user's home directory and &amp;lt;tt&amp;gt;%s&amp;lt;/tt&amp;gt; is the print job's filename, the result is a file whose name begins with the Samba print job name and ends in ''.pdf''. This filename is likely to be ugly, but it will at least be unique. The &amp;lt;tt&amp;gt;print command&amp;lt;/tt&amp;gt; line ends with &amp;lt;tt&amp;gt;rm %s&amp;lt;/tt&amp;gt;, which deletes the original print job, keeping it from cluttering the disk.&lt;br /&gt;
&lt;br /&gt;
Of course, the &amp;lt;tt&amp;gt;[makepdf]&amp;lt;/tt&amp;gt; share, as just presented, requires users to have access to their home directories, presumably through a &amp;lt;tt&amp;gt;[homes]&amp;lt;/tt&amp;gt; share. If this isn't true of your system, you can deliver the results in some other ways. For instance, you might have Samba email the PDF files to users. If necessary, you can write a script that passes the file through Ghostscript, looks up users' email addresses in a list, and sends the file. Then call the script on the &amp;lt;tt&amp;gt;print command&amp;lt;/tt&amp;gt; line, passing it whatever Samba variables you need, such as the print job filename (&amp;lt;tt&amp;gt;%s&amp;lt;/tt&amp;gt;) and the username (&amp;lt;tt&amp;gt;%u&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;%U&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To clients, this particular share is indistinguishable from a real printer's share. Because it expects PostScript input, you should install PostScript drivers on clients—ideally a fairly generic PostScript driver. Instead of printed output, though, users will find PDF files in their home directories soon after printing documents. This share can be a good way to provide basic PDF-generation capabilities to all users in all their programs that can print. It might not be enough for all functions; some dedicated PDF-generation tools support features that aren't available through Ghostscript or Windows PostScript printer drivers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tip&amp;quot;&amp;gt;&lt;br /&gt;
'''Tip'''&lt;br /&gt;
&lt;br /&gt;
You may want to install drivers in Samba for the share for automated delivery to clients, as described in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Delivering Printer Drivers to Windows Clients|Section 4.4]]. You can do so from a Windows client, as described in the [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Installing drivers from Windows NT/200x/XP|Section 4.4.3.2]]. If you create a CUPS queue with the name of the PDF-generation share and set it up using a generic PPD file, you can then install the CUPS PostScript drivers for Windows as described in [[Linux in a Windows World/Sharing Files and Printers/File and Printer Shares#Installing drivers from Linux|Section 4.4.3.1]]. You can then delete the bogus CUPS queue. Alternatively, you can generate the queue to print to a networked SMB/CIFS queue to begin with and point it as the Samba queue you're creating. If you do the latter, CUPS clients can create PDFs by printing to CUPS, which then submits the print job to Samba.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
Samba was created as a file and print server for Linux and other Unix-like operating systems, enabling these systems to fill an important role on many LANs. Although Samba has grown over the years to take on many other SMB/CIFS duties, such as domain controller and NetBIOS name server, sharing files and printers remains at the core of Samba's functionality. Creating these shares requires that you understand the basic Samba share-creation parameters. File shares are likely to use many of these options, but printer shares are likely to use a smaller subset of these options, along with a few printer-specific options. Printer shares also require configuring a local Linux printer queue, which in the case of modern Linux distributions usually means CUPS. Actually using printer shares usually requires driver installation on clients, and Samba provides tools to help automate this process.&lt;/div&gt;</description>
			<pubDate>Tue, 11 Mar 2008 21:46:06 GMT</pubDate>			<dc:creator>Docbook2Wiki</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Linux_in_a_Windows_World/Sharing_Files_and_Printers/File_and_Printer_Shares</comments>		</item>
	</channel>
</rss>