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" />
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";
24
<div id="logo-floater">
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" />
32
<form action="http://www.google.com/cse" id="cse-search-box">
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" />
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>');
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>
61
<div class="breadcrumbs"><a href="https://help.ubuntu.com/">Ubuntu Documentation</a> > <a href="https://help.ubuntu.com/11.04">Ubuntu 11.04</a> > <span class="breadcrumb-link"><a href="index.html">Ubuntu Server Guide</a></span> > <span class="breadcrumb-link"><a href="windows-networking.html">Windows Networking</a></span> > <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">
66
<h2 class="title" style="clear: both"><a id="samba-ad-integration"></a>Samba Active Directory Integration</h2>
70
<div class="sect2" title="Accessing a Samba Share">
71
<div class="titlepage">
74
<h3 class="title"><a id="ad-integration-samba-share"></a>Accessing a Samba Share</h3>
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.
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>.
88
Once part of the Active Directory domain, enter the following command in the terminal prompt:
91
<span class="command"><strong>sudo apt-get install samba smbfs smbclient</strong></span>
94
Next, edit <code class="filename">/etc/samba/smb.conf</code> changing:
96
<pre class="programlisting">
102
idmap backend = lwopen
103
idmap uid = 50-9999999999
104
idmap gid = 50-9999999999
107
Restart <span class="application"><strong>samba</strong></span> for the new settings to take effect:
110
<span class="command"><strong>sudo restart smbd</strong></span>
111
<span class="command"><strong>sudo restart nmbd</strong></span>
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
119
<div class="sect2" title="Accessing a Windows Share">
120
<div class="titlepage">
123
<h3 class="title"><a id="ad-integration-windows-share"></a>Accessing a Windows Share</h3>
128
Now that the Samba server is part of the Active Directory domain you can access any Windows server shares:
130
<div class="itemizedlist">
131
<ul class="itemizedlist" type="disc">
132
<li class="listitem">
134
To mount a Windows file share enter the following in a terminal prompt:
137
<span class="command"><strong>mount.cifs //fs01.example.com/share mount_point</strong></span>
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.
144
<li class="listitem">
146
To mount the share during boot place an entry in <code class="filename">/etc/fstab</code>, for example:
148
<pre class="programlisting">
149
//192.168.0.5/share /mnt/windows cifs auto,username=steve,password=secret,rw 0 0
152
<li class="listitem">
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:
158
<span class="command"><strong>smbclient //fs01.example.com/share -k -c "ls"</strong></span>
161
<li class="listitem">
163
To copy a file from the share, enter:
166
<span class="command"><strong>smbclient //fs01.example.com/share -k -c "get file.txt"</strong></span>
169
This will copy the <code class="filename">file.txt</code> into the current directory.
172
<li class="listitem">
174
And to copy a file to the share:
177
<span class="command"><strong>smbclient //fs01.example.com/share -k -c "put /etc/hosts hosts"</strong></span>
180
This will copy the <code class="filename">/etc/hosts</code> to <code class="filename">//fs01.example.com/share/hosts</code>.
183
<li class="listitem">
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: \></em></span>
187
prompt, a FTP like prompt where you can execute normal file and directory commands, simply execute:
190
<span class="command"><strong>smbclient //fs01.example.com/share -k</strong></span>
195
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
196
<table border="0" summary="Note">
198
<td rowspan="2" align="center" valign="top" width="25">
199
<img alt="[Note]" src="../../libs/admon/note.png" />
201
<th align="left"></th>
204
<td align="left" valign="top">
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.
215
<div class="sect2" title="Resources">
216
<div class="titlepage">
219
<h3 class="title"><a id="ad-integration-resources"></a>Resources</h3>
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>.
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.
233
The <a class="ulink" href="https://help.ubuntu.com/community/Samba" target="_top">Ubuntu Wiki Samba </a> page.
238
<div xmlns="http://www.w3.org/1999/xhtml" class="navfooter">
240
<table width="100%" summary="Navigation footer">
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" />
248
<td width="40%" align="right"> <a accesskey="n" href="backups.html"><img src="../../libs/navig/next.png" alt="Next" /></a></td>
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" />
257
<td width="40%" align="right" valign="top"> Chapter 18. Backups</td>
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>
269
<img src="https://help.ubuntu.com/htdocs/ubuntunew/img/cap-bottom.png" alt="" />