~kim0/serverguide/serverguide-review-ch19

« back to all changes in this revision

Viewing changes to build/serverguide/C/samba-ad-integration.html

  • Committer: Matthew East
  • Date: 2011-05-03 07:11:18 UTC
  • Revision ID: mdke@ubuntu.com-20110503071118-081aatibsr9k2yqy
Add files from ubuntu-docs natty branch, trim to use only those necessary for serverguide

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
<html xmlns="http://www.w3.org/1999/xhtml">
 
4
  <head xmlns="http://www.w3.org/1999/xhtml">
 
5
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 
6
    <title xmlns="">Samba Active Directory Integration</title>
 
7
    <link rel="stylesheet" href="../../libs/ubuntu-book.css" type="text/css" />
 
8
    <link rel="home" href="index.html" title="Ubuntu Server Guide" />
 
9
    <link rel="up" href="windows-networking.html" title="Chapter 17. Windows Networking" />
 
10
    <link rel="prev" href="samba-dc.html" title="Samba as a Domain Controller" />
 
11
    <link rel="next" href="backups.html" title="Chapter 18. Backups" />
 
12
    <link rel="copyright" href="legal.html" title="Credits and License" />
 
13
  </head>
 
14
  <body>
 
15
    <div id="round">
 
16
      <img id="topcap" alt="" src="https://help.ubuntu.com/htdocs/ubuntunew/img/cap-top.png" />
 
17
      <div id="layout" class="container clear-block">
 
18
        <script xmlns="" src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"></script>
 
19
        <script xmlns="" type="text/javascript">
 
20
_uacct = "UA-1018242-8";
 
21
urchinTracker();
 
22
</script>
 
23
        <div id="header">
 
24
          <div id="logo-floater">
 
25
            <h1>
 
26
              <a href="https://help.ubuntu.com" title="Ubuntu Documentation">
 
27
                <img alt="Ubuntu" id="logo" src="https://help.ubuntu.com/htdocs/ubuntunew/img/logo.png" />
 
28
              </a>
 
29
            </h1>
 
30
          </div>
 
31
          <noscript>
 
32
            <form action="http://www.google.com/cse" id="cse-search-box">
 
33
              <div>
 
34
                <input type="hidden" name="cx" value="003883529982892832976:e2vwumte3fq" />
 
35
                <input type="hidden" name="ie" value="UTF-8" />
 
36
                <input type="text" name="q" size="27" />
 
37
                <input type="submit" name="sa" value="Search" />
 
38
              </div>
 
39
            </form>
 
40
          </noscript>
 
41
          <script>
 
42
 document.write('<form action="https://help.ubuntu.com/search.html" id="cse-search-box">');
 
43
 document.write('  <div>');
 
44
 document.write('    <input type="hidden" name="cof" value="FORID:9" />');
 
45
 document.write('    <input type="hidden" name="cx" value="003883529982892832976:e2vwumte3fq" />');
 
46
 document.write('    <input type="hidden" name="ie" value="UTF-8" />');
 
47
 document.write('    <input type="text" name="q" size="27" />');
 
48
 document.write('    <input type="submit" name="sa" value="Search" />');
 
49
 document.write('  </div>');
 
50
 document.write('</form>');
 
51
</script>
 
52
          <div id="sitename">
 
53
            <a href="https://help.ubuntu.com/">
 
54
              <img alt="Official Documentation" src="https://help.ubuntu.com/htdocs/ubuntunew/img/help-about.png" />
 
55
              <span>Official Documentation</span>
 
56
            </a>
 
57
          </div>
 
58
        </div>
 
59
        <div id="page">
 
60
          <div id="content">
 
61
            <div class="breadcrumbs"><a href="https://help.ubuntu.com/">Ubuntu Documentation</a> &gt; <a href="https://help.ubuntu.com/11.04">Ubuntu 11.04</a> &gt; <span class="breadcrumb-link"><a href="index.html">Ubuntu Server Guide</a></span> &gt; <span class="breadcrumb-link"><a href="windows-networking.html">Windows Networking</a></span> &gt; <span class="breadcrumb-node">Samba Active Directory Integration</span></div>
 
62
            <div xmlns="http://www.w3.org/1999/xhtml" class="sect1" title="Samba Active Directory Integration">
 
63
              <div class="titlepage">
 
64
                <div>
 
65
                  <div>
 
66
                    <h2 class="title" style="clear: both"><a id="samba-ad-integration"></a>Samba Active Directory Integration</h2>
 
67
                  </div>
 
68
                </div>
 
69
              </div>
 
70
              <div class="sect2" title="Accessing a Samba Share">
 
71
                <div class="titlepage">
 
72
                  <div>
 
73
                    <div>
 
74
                      <h3 class="title"><a id="ad-integration-samba-share"></a>Accessing a Samba Share</h3>
 
75
                    </div>
 
76
                  </div>
 
77
                </div>
 
78
                <p>
 
79
      Another, use for Samba is to integrate into an existing Windows network.  Once part of an Active Directory domain,
 
80
      Samba can provide file and print services to AD users.
 
81
      </p>
 
82
                <p>
 
83
      The simplest way to join an AD domain is to use <span class="application"><strong>Likewise-open</strong></span>.  For detailed instructions
 
84
      see the <a class="ulink" href="http://www.likewise.com/resources/documentation_library/manuals/open/likewise-open-54-guide.html" target="_top"> 
 
85
      Likewise Open Installation and Administration Guide</a>.
 
86
      </p>
 
87
                <p>
 
88
      Once part of the Active Directory domain, enter the following command in the terminal prompt:
 
89
      </p>
 
90
                <pre class="screen">
 
91
<span class="command"><strong>sudo apt-get install samba smbfs smbclient</strong></span>
 
92
</pre>
 
93
                <p>
 
94
      Next, edit <code class="filename">/etc/samba/smb.conf</code> changing:
 
95
      </p>
 
96
                <pre class="programlisting">
 
97
   workgroup = EXAMPLE
 
98
   ...
 
99
   security = ads
 
100
   realm = EXAMPLE.COM
 
101
   ...
 
102
   idmap backend = lwopen
 
103
   idmap uid = 50-9999999999
 
104
   idmap gid = 50-9999999999
 
105
</pre>
 
106
                <p>
 
107
      Restart <span class="application"><strong>samba</strong></span> for the new settings to take effect:
 
108
      </p>
 
109
                <pre class="screen">
 
110
<span class="command"><strong>sudo restart smbd</strong></span>
 
111
<span class="command"><strong>sudo restart nmbd</strong></span>
 
112
</pre>
 
113
                <p>
 
114
      You should now be able to access any <span class="application"><strong>Samba</strong></span> shares from a Windows client.  However, be sure to give
 
115
      the appropriate AD users or groups access to the share directory.  See <a class="xref" href="samba-fileprint-security.html" title="Securing a Samba File and Print Server">the section called “Securing a Samba File and Print Server”</a> for 
 
116
      more details.
 
117
      </p>
 
118
              </div>
 
119
              <div class="sect2" title="Accessing a Windows Share">
 
120
                <div class="titlepage">
 
121
                  <div>
 
122
                    <div>
 
123
                      <h3 class="title"><a id="ad-integration-windows-share"></a>Accessing a Windows Share</h3>
 
124
                    </div>
 
125
                  </div>
 
126
                </div>
 
127
                <p>
 
128
      Now that the Samba server is part of the Active Directory domain you can access any Windows server shares:
 
129
      </p>
 
130
                <div class="itemizedlist">
 
131
                  <ul class="itemizedlist" type="disc">
 
132
                    <li class="listitem">
 
133
                      <p>
 
134
          To mount a Windows file share enter the following in a terminal prompt:
 
135
          </p>
 
136
                      <pre class="screen">
 
137
<span class="command"><strong>mount.cifs //fs01.example.com/share mount_point</strong></span>
 
138
</pre>
 
139
                      <p>
 
140
          It is also possible to access shares on computers not part of an AD domain, but a username and password 
 
141
          will need to be provided.
 
142
          </p>
 
143
                    </li>
 
144
                    <li class="listitem">
 
145
                      <p>
 
146
          To mount the share during boot place an entry in <code class="filename">/etc/fstab</code>, for example:
 
147
          </p>
 
148
                      <pre class="programlisting">
 
149
//192.168.0.5/share /mnt/windows cifs auto,username=steve,password=secret,rw 0        0
 
150
</pre>
 
151
                    </li>
 
152
                    <li class="listitem">
 
153
                      <p>
 
154
          Another way to copy files from a Windows server is to use the <span class="application"><strong>smbclient</strong></span> utility.  To 
 
155
          list the files in a Windows share:
 
156
          </p>
 
157
                      <pre class="screen">
 
158
<span class="command"><strong>smbclient //fs01.example.com/share -k -c "ls"</strong></span>
 
159
</pre>
 
160
                    </li>
 
161
                    <li class="listitem">
 
162
                      <p>
 
163
          To copy a file from the share, enter:
 
164
          </p>
 
165
                      <pre class="screen">
 
166
<span class="command"><strong>smbclient //fs01.example.com/share -k -c "get file.txt"</strong></span>
 
167
</pre>
 
168
                      <p>
 
169
          This will copy the <code class="filename">file.txt</code> into the current directory.
 
170
          </p>
 
171
                    </li>
 
172
                    <li class="listitem">
 
173
                      <p>
 
174
          And to copy a file to the share:
 
175
          </p>
 
176
                      <pre class="screen">
 
177
<span class="command"><strong>smbclient //fs01.example.com/share -k -c "put /etc/hosts hosts"</strong></span>
 
178
</pre>
 
179
                      <p>
 
180
          This will copy the <code class="filename">/etc/hosts</code> to <code class="filename">//fs01.example.com/share/hosts</code>.
 
181
          </p>
 
182
                    </li>
 
183
                    <li class="listitem">
 
184
                      <p>
 
185
          The <span class="emphasis"><em>-c</em></span> option used above allows you to execute the <span class="application"><strong>smbclient</strong></span> command
 
186
          all at once.  This is useful for scripting and minor file operations.  To enter the <span class="emphasis"><em>smb: \&gt;</em></span>
 
187
          prompt, a FTP like prompt where you can execute normal file and directory commands, simply execute:
 
188
          </p>
 
189
                      <pre class="screen">
 
190
<span class="command"><strong>smbclient //fs01.example.com/share -k</strong></span>
 
191
</pre>
 
192
                    </li>
 
193
                  </ul>
 
194
                </div>
 
195
                <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
 
196
                  <table border="0" summary="Note">
 
197
                    <tr>
 
198
                      <td rowspan="2" align="center" valign="top" width="25">
 
199
                        <img alt="[Note]" src="../../libs/admon/note.png" />
 
200
                      </td>
 
201
                      <th align="left"></th>
 
202
                    </tr>
 
203
                    <tr>
 
204
                      <td align="left" valign="top">
 
205
                        <p>
 
206
        Replace all instances of <span class="emphasis"><em>fs01.example.com/share</em></span>, <span class="emphasis"><em>//192.168.0.5/share</em></span>, 
 
207
        <span class="emphasis"><em>username=steve,password=secret</em></span>, and <span class="emphasis"><em>file.txt</em></span> with your server's IP, hostname, 
 
208
        share name, file name, and an actual username and password with rights to the share.
 
209
        </p>
 
210
                      </td>
 
211
                    </tr>
 
212
                  </table>
 
213
                </div>
 
214
              </div>
 
215
              <div class="sect2" title="Resources">
 
216
                <div class="titlepage">
 
217
                  <div>
 
218
                    <div>
 
219
                      <h3 class="title"><a id="ad-integration-resources"></a>Resources</h3>
 
220
                    </div>
 
221
                  </div>
 
222
                </div>
 
223
                <p>
 
224
      For more <span class="application"><strong>smbclient</strong></span> options see the man page: <span class="command"><strong>man smbclient</strong></span>, also available
 
225
      <a class="ulink" href="http://manpages.ubuntu.com/manpages/natty/en/man1/smbclient.1.html" target="_top">online</a>.
 
226
      </p>
 
227
                <p>
 
228
      The <span class="application"><strong>mount.cifs</strong></span> 
 
229
      <a class="ulink" href="http://manpages.ubuntu.com/manpages/natty/en/man8/mount.cifs.8.html" target="_top">man page</a> is also useful for 
 
230
      more detailed information.
 
231
      </p>
 
232
                <p>
 
233
      The <a class="ulink" href="https://help.ubuntu.com/community/Samba" target="_top">Ubuntu Wiki Samba </a> page.
 
234
      </p>
 
235
              </div>
 
236
            </div>
 
237
          </div>
 
238
          <div xmlns="http://www.w3.org/1999/xhtml" class="navfooter">
 
239
            <hr />
 
240
            <table width="100%" summary="Navigation footer">
 
241
              <tr>
 
242
                <td width="40%" align="left"><a accesskey="p" href="samba-dc.html"><img src="../../libs/navig/prev.png" alt="Prev" /></a> </td>
 
243
                <td width="20%" align="center">
 
244
                  <a accesskey="u" href="windows-networking.html">
 
245
                    <img src="../../libs/navig/up.png" alt="Up" />
 
246
                  </a>
 
247
                </td>
 
248
                <td width="40%" align="right"> <a accesskey="n" href="backups.html"><img src="../../libs/navig/next.png" alt="Next" /></a></td>
 
249
              </tr>
 
250
              <tr>
 
251
                <td width="40%" align="left" valign="top">Samba as a Domain Controller </td>
 
252
                <td width="20%" align="center">
 
253
                  <a accesskey="h" href="index.html">
 
254
                    <img src="../../libs/navig/home.png" alt="Home" />
 
255
                  </a>
 
256
                </td>
 
257
                <td width="40%" align="right" valign="top"> Chapter 18. Backups</td>
 
258
              </tr>
 
259
            </table>
 
260
          </div>
 
261
          <hr />
 
262
          <div id="footer">
 
263
            <div id="ubuntulinks">
 
264
              <p>The material in this document is available under a free license, see <a href="/legal.html">Legal</a> for details<br />
 
265
        For information on contributing see the <a href="https://wiki.ubuntu.com/DocumentationTeam">Ubuntu Documentation Team wiki page</a>. To report a problem, visit the <a href="https://bugs.launchpad.net/ubuntu/+source/ubuntu-docs">bug page for Ubuntu Documentation</a></p>
 
266
            </div>
 
267
          </div>
 
268
          <div id="bottomcap">
 
269
            <img src="https://help.ubuntu.com/htdocs/ubuntunew/img/cap-bottom.png" alt="" />
 
270
          </div>
 
271
        </div>
 
272
      </div>
 
273
    </div>
 
274
  </body>
 
275
</html>