rane 05/10/09 18:31:43 Modified: xml/htdocs/doc/en/articles samba-p1.xml Added: xml/htdocs/doc/en/articles samba-p2.xml samba-p3.xml Log: #106233, two new articles
Revision Changes Path 1.2 +1 -13 xml/htdocs/doc/en/articles/samba-p1.xml file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/samba-p1.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/samba-p1.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/samba-p1.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo Index: samba-p1.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/samba-p1.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- samba-p1.xml 9 Oct 2005 11:26:57 -0000 1.1 +++ samba-p1.xml 9 Oct 2005 18:31:43 -0000 1.2 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/samba-p1.xml,v 1.1 2005/10/09 11:26:57 rane Exp $ --> +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/samba-p1.xml,v 1.2 2005/10/09 18:31:43 rane Exp $ --> <guide link="/doc/en/articles/samba-p1.xml" disclaimer="articles"> <title>Introduction to Samba, Part 1</title> @@ -399,10 +399,6 @@ <ul> <li>The main <uri link="http://fi.samba.org">Samba</uri> web site</li> - <li> - <uri link="http://www.kampsax.dtu.dk/~rask/Samba/mailinglist/">Amiga - Samba</uri> mailing list - </li> <li><uri link="http://linuxguy.net/samba.htm">Samba</uri> by Ed Weinberg</li> <li> <e><uri link="http://www.amazon.com/exec/obidos/ASIN/0672318628/">Samba @@ -413,20 +409,12 @@ (O'Reilly Publishing; 1999) </li> <li> - <uri link="http://www.mdb.ku.dk/tarvin/samba/">Samba Notes</uri> on Samba - and Redhat - </li> - <li> <uri link="http://jazz.external.hp.com/src/samba/">Samba/iX</uri>: Samba support on MPE/iX 6.0 </li> <li> The <uri link="http://fi.samba.org/docs/swat_ssl.html">SWAT</uri> main page </li> - <li> - <uri link="http://www.cs.wisc.edu/">GhostScript</uri> at the University of - Wisconsin. - </li> </ul> </body> 1.1 xml/htdocs/doc/en/articles/samba-p2.xml file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/samba-p2.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/samba-p2.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo Index: samba-p2.xml =================================================================== <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/samba-p2.xml,v 1.1 2005/10/09 18:31:43 rane Exp $ --> <guide link="/doc/en/articles/samba-p2.xml" disclaimer="articles"> <title>Introduction to Samba, Part 2</title> <author title="Author"> <mail link="[EMAIL PROTECTED]">Daniel Robbins</mail> </author> <!-- <author title="Editor"> <mail link="[EMAIL PROTECTED]">Joshua Saddler</mail> </author> --> <abstract> In his previous article, Daniel introduced you to what Samba can do. Now it's time to get it running on your system. In this article, he'll walk you through the process of compiling, installing, and initially configuring Samba (version 2.0.7) so that it works in your environment. </abstract> <!-- The original version of this article was first published on IBM developerWorks, and is property of Westtech Information Services. This document is an updated version of the original article, and contains various improvements made by the Gentoo Linux Documentation team --> <version>1.0</version> <date>2005-10-06</date> <chapter> <title>Compiling, installing, and configuring Samba for your environment</title> <section> <title>Downloading Samba</title> <body> <p> OK, it's time to download Samba 2.0.7 or greater from the Samba.org Web site (see <uri link="#resources">Resources</uri> later in this article). </p> <note> While I'll be compiling Samba from scratch, you may choose to install Samba from a binary package (such as RPM that came with your Linux distribution). This is perfectly OK. But, as I mentioned in my last article, if you do this, your file locations may be slightly different than what I refer to here. </note> <p> After you've downloaded Samba 2.0.7 or greater, it's time to decompress it to a directory location of your choice. From the command prompt, type: </p> <pre caption="Unpacking the source files"> $ <i>tar -xzvf samba-2.0.7.tar.gz</i> </pre> <p> A <path>samba-2.0.7</path> directory will be created. <c>cd</c> into it, and we'll take a look around. First, notice the docs directory. Inside it you'll see another directory called <path>textdocs</path>. <path>texdocs</path> contains a whole bunch of Samba documentation. One of the most important files in the <path>textdocs</path> directory is called DIAGNOSIS.txt. It walks you through a step-by-step process of diagnosing problems you may have with proper Samba operation. We'll be covering some, but not all, of the diagnosis procedures mentioned in this file. </p> </body> </section> <section> <title>Compiling and installing Samba</title> <body> <p> You'll also notice the <path>sources</path> directory in the main <path>samba-2.0.7</path> directory. Inside <path>sources</path> you'll find a well designed configure script designed to set up all the makefiles properly. As with any other configure script, to get a list of the configuration options, type: </p> <pre caption="Investigating options"> $ <i>./configure --help</i> </pre> <p> You will probably want to pipe the output to <c>more</c> so that you can view all the options: </p> <pre caption="Even more options"> $ <i>./configure --help | more</i> </pre> <p> Note the directory and file name options. Notice where everything gets installed, and that the default install path is <path>/usr/local/samba</path>. You will probably want to change this to <path>/usr/local</path> by passing the <c>--prefix=/usr/local</c> option when you configure Samba. For this example, I'm going to use the following path settings: </p> <pre caption="Configuring the directory options"> $ <i>./configure --prefix=/usr/local --localstatedir=/var/log --sysconfdir=/etc</i> </pre> <p> The above configuration options will cause Samba's default tree to be in <path>/usr/local</path>, with the exception of the configuration files. Samba will expect to find these in <path>/etc</path> and log files, which will end up in <path>/var/log</path>. If you omit those configure options, you'll find everything in the <path>/usr/local/samba</path> directory tree (<path>/usr/local/samba/var</path>, <path>/usr/local/samba/etc</path>, etc.). </p> <p> It's now time to start the compilation. After running <c>configure</c>, type: </p> <pre caption="Compiling Samba"> $ <i>make</i> </pre> <p> After compilation completes, type the following as root to install the software: </p> <pre caption="Installing Samba"> # <i>make install</i> </pre> </body> </section> <section> <title>Configuring the server</title> <body> <p> For the most part, configuring Samba begins and ends with the <path>smb.conf</path> file. This is Samba's main configuration file. It has many different configuration options. To avoid confusion, we're going to start only with those options essential to the proper operation of Samba. First, you'll need to find out where <path>smb.conf</path> should be. If you used the configuration options I specified above, you should place <path>smb.conf</path> in <path>/etc</path>. If you used the default paths, Samba will look for it in <path>/usr/local/samba/etc</path>. To get started, <c>cd</c> to the appropriate directory, fire up your favorite text editor, and type in the following lines. I'll intersperse commentary along the way to provide you with a good understanding of what each option does. Add these lines to your <path>smb.conf</path> file: </p> <pre caption="smb.conf"> [global] workgroup = YOURWORKGROUP security = user encrypt passwords = yes guest account = guest </pre> <p> The first line tells Samba that we are placing options in the "global" section. There are many options that are intended to be defined only in this section. These options control the global behavior of Samba. </p> <p> The second line tells Samba the name of the Windows workgroup that Samba will create. Replace YOURWORKGROUP with an appropriate name for your workgroup. </p> <p> On the third line, we tell Samba to run in user-level security mode. This option will cause Samba to tell all connecting Windows clients that they need to provide a valid username/password combination to gain access to any network resource. This is definitely a good thing. User-level security is Samba's most often used security level because it's an excellent match for the majority of file sharing situations. However, there are other security levels available. One handy mode tells Samba to authenticate all users against the security database of an existing Windows NT or 2000 Server. We won't be covering that particular mode in this article. If you want more information about it, take a look the "security" option in the <path>smb.conf</path> main page. </p> <p> Now, on to the fourth line. Here we tell Samba to exchange passwords with Samba in encrypted mode. You will always want to run Samba in encrypted mode, unless all your client machines are extremely ancient (like Windows for Workgroups-era machines). Enabling encrypted passwords does cause Samba to need its own password file, in addition to the standard Unix password database. If you are thinking that it may be nice to turn encrypted passwords off, so that you can avoid having to maintain two password files, don't do it! Turning encrypted passwords off will cause sharing problems with even moderately old versions of Windows NT 4.0 in addition to Windows 2000. If you really want to avoid maintaining two separate databases, Samba provides several ways to synchronize both databases, which is a better approach. </p> 1.1 xml/htdocs/doc/en/articles/samba-p3.xml file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/samba-p3.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/samba-p3.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo Index: samba-p3.xml =================================================================== <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/samba-p3.xml,v 1.1 2005/10/09 18:31:43 rane Exp $ --> <guide link="/doc/en/articles/samba-p3.xml" disclaimer="articles"> <title>Introduction to Samba, Part 3</title> <author title="Author"> <mail link="[EMAIL PROTECTED]">Daniel Robbins</mail> </author> <!-- <author title="Editor"> <mail link="[EMAIL PROTECTED]">Joshua Saddler</mail> </author> --> <abstract> In his previous article, Daniel Robbins guided you through the process of setting up Samba for the first time. Now it's time to configure Samba so that it does everything that you want it to do. </abstract> <!-- The original version of this article was first published on IBM developerWorks, and is property of Westtech Information Services. This document is an updated version of the original article, and contains various improvements made by the Gentoo Linux Documentation team --> <version>1.0</version> <date>2005-10-08</date> <chapter> <title>Getting Samba to samba: The configuration stage</title> <section> <title>A brief review</title> <body> <p> Here's a listing of the <path>smb.conf</path> that we've been working with: </p> <pre caption="/etc/smb.conf"> [global] <comment># set YOURWORKGROUP to the name of your workgroup</comment> workgroup = YOURWORKGROUP security = user encrypt passwords = yes guest account = guest <comment># enable *one* of the following two lines</comment> <comment># enable the first line if you want to use an existing</comment> <comment># WINS server on your subnet, otherwise, enable the</comment> <comment># second.</comment> # wins server = IP address of WINS server # wins support = yes local master = yes os level = 99 domain master = yes preferred master = yes <comment># optional security options. Customize for your site.</comment> # hosts allow = 192.168.1. 127. # interfaces = eth1 [tmp] path=/tmp writeable=yes </pre> </body> </section> <section> <title>Adding some shares</title> <body> <p> While this <path>smb.conf</path> file is functional, all it does is share the <path>/tmp</path> directory with Windows by creating a share with the name of "tmp". Not too exciting. Let's create another share that could be more useful. Add the following lines to your <path>smb.conf</path> and restart Samba. </p> <pre caption="Adding an FTP share"> [ftp] path=/path/to/ftp/root writeable=no </pre> <p> If you have an ftp site or some kind of file archive on your Samba server, you can use something like this to share the data over the network. The <b>writeable=no</b> parameter tells Samba that no one should be allowed to create or modify files on this share. Anyone who has a valid Samba account set up will be able to access this share. </p> </body> </section> <section> <title>An exciting share</title> <body> <p> OK, I know what you're thinking. This still isn't too exciting. How about sharing a home directory? Here's how: </p> <pre caption="Sharing a home directory"> [drobbins] comment=Home directory for drobbins path = /home/drobbins force user = drobbins read only = no valid users = drobbins administrator </pre> <p> This one is a lot more interesting. Adding something like this to your <path>smb.conf</path> will allow you to share a home directory. In this example, a "drobbins" share is created. This shares the contents of <path>/home/drobbins</path> over the network. Fortunately, however, thanks to the <b>valid users</b> line, not just anyone can access this hare. This line causes Samba to reject access by anyone other than the "drobbins" or "administrator" account. Since I'm using Windows NT, I'm often logged in as administrator. In such situations, it's nice to still be able to access the "drobbins" share. Such a valid users line allows this to happen. </p> <p> You'll also notice the use of the <b>read only</b> parameter. As you might guess, <b>read only</b> is the opposite of the <b>writeable</b> parameter. We could have just as easily replaced this line with <b>writeable=yes</b>. This means that Samba will permit writing to this particular share, as long as you have the proper permissions to do so. Since the Samba "drobbins" user maps directly to the Unix "drobbins" user, and drobbins happens to be the owner of the <path>/home/drobbins</path> directory and its contents, writing and modifying files will be permitted. </p> <p> Have you ever created a file in your home directory as root, and then tried to modify it when you're logged in as a normal user only to be denied write access? This seems to happen all the time to me. To fix the problem, I need to <c>su</c>, <c>chown drobbins.drobbins filename</c> and then <c>exit</c> from root. Finally, I'm allowed to modify the file. </p> <p> I bring this up because a similar problem can occur when you share out home directories and access them using different Samba users. Consider the following situation. I access a share as administrator and created a file. Normally, this file would be owned by administrator and it would not be modifiable by the drobbins user. If drobbins tried to modify it, access would be denied. Fortunately, Samba has the <b>force user</b> option that works around this situation. The <b>force user</b> option will cause all actions performed on files (on a particular Samba SMB/CIFS share) to be performed using a single Unix account. In my "drobbins" share example, this means that any files that administrator creates will actually be owned by drobbins, preventing any ownership conflicts. Since the "drobbins" share contains the contents of my home directory, I like to keep everything in it owned by the drobbins account. </p> <p> Before we head on to the next topic, I should mention the <b>comment</b> parameter. This allows you to complement your share with a descriptive comment visible from Windows. </p> </body> </section> <section> <title>Sharing lots of home directories</title> <body> <p> So, we've covered how to share a single home directory. But what do you do if you happen to administrate a server that contains hundreds of users, all of whom want to be able to access their home directories from Windows? Fortunately, Samba has a special share just for this purpose called "homes". Here's how it works: </p> <pre caption="Sharing multiple homes"> [homes] comment=Home directory for %S path=/home/%u valid users = %u administrator force user=%u writeable = yes browseable = no </pre> <p> As I mentioned, this is a "special" share. It doesn't work like ordinary shares. Samba recognizes the special identifier <b>[homes]</b> and treats this share differently. </p> -- [email protected] mailing list
