/[gentoo]/xml/htdocs/doc/en/quick-samba-howto.xml
Gentoo

Diff of /xml/htdocs/doc/en/quick-samba-howto.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.29 Revision 1.36
1<?xml version='1.0' encoding='UTF-8'?> 1<?xml version='1.0' encoding='UTF-8'?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/quick-samba-howto.xml,v 1.29 2007/06/06 23:23:35 nightmorph Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/quick-samba-howto.xml,v 1.36 2007/12/01 11:25:01 neysx Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4
4<guide link="/doc/en/quick-samba-howto.xml"> 5<guide link="/doc/en/quick-samba-howto.xml">
6
5<title>Gentoo Samba3/CUPS/ClamAV HOWTO</title> 7<title>Gentoo Samba3/CUPS/ClamAV HOWTO</title>
8
6<author title="Author"> 9<author title="Author">
7 <mail link="daff at dword dot org">Andreas "daff" Ntaflos</mail> 10 <mail>Andreas "daff" Ntaflos</mail><!--daff at dword dot org-->
8</author> 11</author>
9<author title="Author"> 12<author title="Author">
10 <mail link="joshua@sungentoo.homeunix.com">Joshua Preston</mail> 13 <mail link="joshua@sungentoo.homeunix.com">Joshua Preston</mail>
14</author>
15<author title="Editor">
16 <mail link="nightmorph@gentoo.org">Joshua Saddler</mail>
11</author> 17</author>
12 18
13<abstract> 19<abstract>
14Setup, install and configure a Samba Server under Gentoo that shares files, 20Setup, install and configure a Samba Server under Gentoo that shares files,
15printers without the need to install drivers and provides automatic virus 21printers without the need to install drivers and provides automatic virus
16scanning. 22scanning.
17</abstract> 23</abstract>
18 24
19<!-- The content of this document is licensed under the CC-BY-SA license --> 25<!-- The content of this document is licensed under the CC-BY-SA license -->
20<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 26<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
21<license/> 27<license/>
22 28
23<version>1.17</version> 29<version>1.23</version>
24<date>2007-06-06</date> 30<date>2007-12-01</date>
25 31
26<chapter> 32<chapter>
27<title>Introduction to this HOWTO</title> 33<title>Introduction to this HOWTO</title>
28<section> 34<section>
29<title>Purpose</title> 35<title>Purpose</title>
152 </li> 158 </li>
153</ul> 159</ul>
154 160
155<p> 161<p>
156The main package we use here is net-fs/samba, however, you will need a kernel 162The main package we use here is net-fs/samba, however, you will need a kernel
157with smbfs support enabled in order to mount a samba or windows share from 163with cifs support enabled in order to mount a samba or windows share from
158another computer. CUPS will be emerged if it is not already. 164another computer. CUPS will be emerged if it is not already.
159app-antivirus/clamav will be used also, but others should be easily adapted to 165app-antivirus/clamav will be used also, but others should be easily adapted to
160work with Samba. Gentoo's samba ebuild supports all kinds of virus scanning 166work with Samba. Gentoo's samba ebuild supports all kinds of virus scanning
161technologies, such as Sophos, FProt, Fsav, Trend, Icap, Nai, ... 167technologies, such as Sophos, FProt, Fsav, Trend, Icap, Nai, ...
162</p> 168</p>
317<pre caption="Emerge Samba"> 323<pre caption="Emerge Samba">
318# <i>echo "net-fs/samba oav readline cups pam" &gt;&gt; /etc/portage/package.use</i> 324# <i>echo "net-fs/samba oav readline cups pam" &gt;&gt; /etc/portage/package.use</i>
319# <i>emerge net-fs/samba</i> 325# <i>emerge net-fs/samba</i>
320</pre> 326</pre>
321 327
322<note>
323The following arches will need to add <e>~</e> to their <e>KEYWORDS</e>: x86,
324ppc, sparc, hppa, ia64 and alpha
325</note>
326
327<p> 328<p>
328This will emerge Samba and CUPS (if CUPS is not already emerged). 329This will emerge Samba and CUPS (if CUPS is not already emerged).
329</p> 330</p>
330 331
331</body> 332</body>
416hosts deny = 0.0.0.0/0 417hosts deny = 0.0.0.0/0
417<comment># Other options for this are USER, DOMAIN, ADS, and SERVER 418<comment># Other options for this are USER, DOMAIN, ADS, and SERVER
418# The default is user</comment> 419# The default is user</comment>
419security = share 420security = share
420<comment># No passwords, so we're going to use a guest account!</comment> 421<comment># No passwords, so we're going to use a guest account!</comment>
421guest account = samba
422guest ok = yes 422guest ok = yes
423<comment># We now will implement the on access virus scanner. 423<comment># We now will implement the on access virus scanner.
424# NOTE: By putting this in our [Global] section, we enable 424# NOTE: By putting this in our [Global] section, we enable
425# scanning of ALL shares, you could optionally move 425# scanning of ALL shares, you could optionally move
426# these to a specific share and only scan it.</comment> 426# these to a specific share and only scan it.</comment>
776 776
777<p> 777<p>
778There are two sets of printer drivers for this. First, the Adobe PS drivers 778There are two sets of printer drivers for this. First, the Adobe PS drivers
779which can be obtained from <uri 779which can be obtained from <uri
780link="http://www.adobe.com/support/downloads/main.html">Adobe</uri> (PostScript 780link="http://www.adobe.com/support/downloads/main.html">Adobe</uri> (PostScript
781printer drivers). Second, there are the CUPS PS drivers, to be obtained <uri 781printer drivers). Second, there are the CUPS PS drivers, to be obtained by
782link="http://dev.gentoo.org/~nightmorph/misc/cups-samba-5.0rc2.tar.gz">here</uri>. 782emerging <c>net-print/cups-windows</c>. Note that it may still be marked ~arch,
783so you may need to add it to <path>/etc/portage/package.keywords</path>. There
783There doesn't seem to be a difference between the functionality of the two, but 784doesn't seem to be a difference between the functionality of the two, but the
784the Adobe PS drivers need to be extracted on a Windows System since it's a 785Adobe PS drivers need to be extracted on a Windows System since it's a Windows
785Windows binary. Also the whole procedure of finding and copying the correct 786binary. Also the whole procedure of finding and copying the correct files is a
786files is a bit more hassle. The CUPS drivers seem to support some options the 787bit more hassle. The CUPS drivers support some options the Adobe drivers
787Adobe drivers don't. 788don't.
788</p>
789<!--
790used to be available at www.cups.org/articles.php?L142+p4, but only 6.0 is
791available. at some point, we should update this for 6.0.
792-->
793
794<p> 789</p>
795This HOWTO uses the CUPS drivers for Windows. The downloaded file is 790
796called <path>cups-samba-5.0rc2.tar.gz</path>. Extract the files
797contained into a directory.
798</p> 791<p>
799 792This HOWTO uses the CUPS drivers for Windows. Install them as shown:
800<pre caption="Extract the drivers and run the install">
801# <i>tar -xzf cups-samba-5.0rc2.tar.gz</i>
802# <i>cd cups-samba-5.0rc2</i>
803<comment>(Only use this script if CUPS resides in /usr/share/cups)</comment>
804# <i>./cups-samba.install</i>
805</pre>
806
807<p> 793</p>
808<path>cups-samba.ss</path> is a TAR archive containing three files:
809<path>cups5.hlp</path>, <path>cupsdrvr5.dll</path> and
810<path>cupsui5.dll</path>. These are the actual driver files.
811</p>
812 794
813<warn>
814The script <c>cups-samba.install</c> may not work for all *nixes (i.e. FreeBSD)
815because almost everything which is not part of the base system is installed
816somewhere under the prefix <path>/usr/local/</path>. This seems not to be the
817case for most things you install under GNU/Linux. However, if your CUPS
818installation is somewhere other than <path>/usr/share/cups/</path> see the
819example below.
820</warn>
821
822<p>
823Suppose your CUPS installation resides under
824<path>/usr/local/share/cups/</path>, and you want to install the drivers there.
825Do the following:
826</p>
827
828<pre caption="Manually installing the drivers"> 795<pre caption="Install the drivers">
829# <i>cd /path/you/extracted/the/CUPS-driver/tarball/into</i> 796# <i>emerge -av cups-windows</i>
830# <i>tar -xf cups-samba.ss</i>
831<comment>(This extracts the files to usr/share/cups/drivers under the CURRENT WORKING DIRECTORY)</comment>
832# <i>cd usr/share/cups/drivers</i>
833<comment>(no leading / !)</comment>
834# <i>cp cups* /usr/local/share/cups/drivers</i>
835# <i>/etc/init.d/cupsd restart</i>
836</pre> 797</pre>
837 798
838<p> 799<p>
839Now we'll use the script <c>cupsaddsmb</c> provided by the CUPS distribution. 800Now we'll use the script <c>cupsaddsmb</c> provided by the CUPS distribution.
840Its man page is an interesting read. 801Be sure to read its manpage (<c>man cupsaddsmb</c>), as it will tell you which
802Windows drivers you'll need to copy to the proper CUPS directory. Once you've
803copied the drivers, restart CUPS by running <c>/etc/init.d/cupsd restart</c>.
804Next, run <c>cupsaddsmb</c> as shown:
841</p> 805</p>
842 806
843<pre caption="Run cupsaddsmb"> 807<pre caption="Run cupsaddsmb">
844# <i>cupsaddsmb -H PrintServer -U root -h PrintServer -v HPDeskJet930C</i> 808# <i>cupsaddsmb -H PrintServer -U root -h PrintServer -v HPDeskJet930C</i>
845<comment>(Instead of HPDeskJet930C you could also specify "-a", which will 809<comment>(Instead of HPDeskJet930C you could also specify "-a", which will
1025</section> 989</section>
1026<section> 990<section>
1027<title>Mounting a Windows or Samba share in GNU/Linux</title> 991<title>Mounting a Windows or Samba share in GNU/Linux</title>
1028<body> 992<body>
1029 993
994<note>
995Don't forget to install <c>net-fs/mount-cifs</c> or <c>net-fs/samba</c> on the
996client(s) that will be accessing the shares.
997</note>
998
1030<p> 999<p>
1031Now is time to configure our kernel to support smbfs. Since I'm assumming we've 1000Now is time to configure our kernel to support cifs. Since I'm assuming
1032all compiled at least one kernel, we'll need to make sure we have all the right 1001we've all compiled at least one kernel, we'll need to make sure we have all the
1033options selected in our kernel. For simplicity's sake, make it a module for ease 1002right options selected in our kernel. For simplicity's sake, make it a module
1034of use. It is the author's opinion that kernel modules are a good thing and 1003for ease of use. It is the author's opinion that kernel modules are a good thing
1035should be used whenever possible. 1004and should be used whenever possible.
1036</p>
1037
1038<pre caption="Relevant kernel options" >
1039CONFIG_SMB_FS=m
1040CONFIG_SMB_UNIX=y
1041</pre>
1042
1043<p> 1005</p>
1006
1007<pre caption="Kernel support" >
1008CONFIG_CIFS=m
1009</pre>
1010
1011<p>
1044Then make the module/install it; insert them with: 1012Then make the module/install it; insert it with:
1045</p> 1013</p>
1046 1014
1047<pre caption="Loading the kernel module"> 1015<pre caption="Loading the kernel module">
1048# <i>modprobe smbfs</i> 1016# <i>modprobe cifs</i>
1049</pre> 1017</pre>
1050 1018
1051<p> 1019<p>
1052Once the module is loaded, mounting a Windows or Samba share is possible. Use 1020Once the module is loaded, mounting a Windows or Samba share is possible. Use
1053<c>mount</c> to accomplish this, as detailed below: 1021<c>mount</c> to accomplish this, as detailed below:
1054</p> 1022</p>
1055 1023
1056<pre caption="Mounting a Windows/Samba share"> 1024<pre caption="Mounting a Windows/Samba share">
1057<comment>(The syntax for mounting a Windows/Samba share is: 1025<comment>(The syntax for mounting a Windows/Samba share is:
1058 mount -t smbfs [-o username=xxx,password=xxx] //server/share /mnt/point 1026 mount -t cifs [-o username=xxx,password=xxx] //server/share /mnt/point
1059If we are not using passwords or a password is not needed)</comment> 1027If we are not using passwords or a password is not needed)</comment>
1060 1028
1061# <i>mount -t smbfs //PrintServer/public /mnt/public</i> 1029# <i>mount -t cifs //PrintServer/public /mnt/public</i>
1062 1030
1063<comment>(If a password is needed)</comment> 1031<comment>(If a password is needed)</comment>
1064# <i>mount -t smbfs -o username=USERNAME,password=PASSWORD //PrintServer/public /mnt/public</i> 1032# <i>mount -t cifs -o username=USERNAME,password=PASSWORD //PrintServer/public /mnt/public</i>
1065</pre> 1033</pre>
1066 1034
1067<p> 1035<p>
1068After you mount the share, you would access it as if it were a local drive. 1036After you mount the share, you would access it as if it were a local drive.
1069</p> 1037</p>

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.20