1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title xmlns="">Integrare Samba con Active Directory</title>
<link rel="stylesheet" href="../../libs/ubuntu-book.css" type="text/css" />
<link rel="home" href="index.html" title="Guida a Ubuntu Server" />
<link rel="up" href="windows-networking.html" title="Capitolo 17. Reti Windows" />
<link rel="prev" href="samba-dc.html" title="Samba come controller di dominio" />
<link rel="next" href="backups.html" title="Capitolo 18. Backup" />
<link rel="copyright" href="legal.html" title="Riconoscimenti e licenza" />
</head>
<link href="http://help.ubuntu-it.org/favicon.ico" rel="shortcut icon" />
<body>
<div id="page-border-left-repeat">
<div id="page-border-right-repeat">
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-8147493-2");
pageTracker._trackPageview();
} catch(err) {}</script>
<div id="page-border-top-repeat">
<div id="header">
<div id="header-navigation">
<ul>
<li>
<a href="http://www.ubuntu-it.org">Web</a>
</li>
<li>
<a href="http://wiki.ubuntu-it.org">Documentazione</a>
</li>
<li>
<a href="http://forum.ubuntu-it.org">Forum</a>
</li>
<li>
<a href="http://planet.ubuntu-it.org">Planet</a>
</li>
</ul>
</div>
<form action="http://help.ubuntu-it.org/11.04/ubuntu/search.php" id="cse-search-box">
<div>
<input type="text" name="s" size="28" title="search" />
<input type="submit" value="Cerca" title="search" />
</div>
</form>
</div>
</div>
<div>
<div id="bodyarea">
<div class="pagelocation"><a href="http://help.ubuntu-it.org/">Documentazione di Ubuntu</a> > <a href="http://help.ubuntu-it.org/11.04/ubuntu/index.html">Ubuntu 11.04</a> > <span class="breadcrumb-link"><a href="index.html">Guida a Ubuntu Server</a></span> > <span class="breadcrumb-link"><a href="windows-networking.html">Reti Windows</a></span> > <span class="breadcrumb-node">Integrare Samba con Active Directory</span></div>
<div xmlns="http://www.w3.org/1999/xhtml" class="sect1" title="Integrare Samba con Active Directory">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="samba-ad-integration"></a>Integrare Samba con Active Directory</h2>
</div>
</div>
</div>
<div class="sect2" title="Accedere a una condivisione Samba">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="ad-integration-samba-share"></a>Accedere a una condivisione Samba</h3>
</div>
</div>
</div>
<p>Un altro uso di Samba consiste nell'integrarlo all'interno di una rete Windows esistente. Una volta parte di un dominio Active Directory, Samba può fornire servizi di file e stampa agli utenti AD.</p>
<p>
The simplest way to join an AD domain is to use <span class="application"><strong>Likewise-open</strong></span>. For detailed instructions
see the <a class="ulink" href="http://www.likewise.com/resources/documentation_library/manuals/open/likewise-open-54-guide.html" target="_top">
Likewise Open Installation and Administration Guide</a>.
</p>
<p>
Once part of the Active Directory domain, enter the following command in the terminal prompt:
</p>
<pre class="screen">
<span class="command"><strong>sudo apt-get install samba smbfs smbclient</strong></span>
</pre>
<p>Aprire il file <code class="filename">/etc/samba/smb.conf</code> e modificare quanto segue:</p>
<pre class="programlisting">
workgroup = EXAMPLE
...
security = ads
realm = EXAMPLE.IT
...
idmap backend = lwopen
idmap uid = 50-9999999999
idmap gid = 50-9999999999
</pre>
<p>Riavviare <span class="application"><strong>samba</strong></span> affinché le nuove impostazioni abbiano effetto:</p>
<pre class="screen">
<span class="command"><strong>sudo restart smbd</strong></span>
<span class="command"><strong>sudo restart nmbd</strong></span>
</pre>
<p>Dovrebbe essere ora possibile accedere qualsiasi condivisione <span class="application"><strong>Samba</strong></span> da un client Windows. Assicurarsi comunque di concedere agli utenti o ai gruppi AD accesso alla directory condivisa. Per maggiori informazioni, consultare <a class="xref" href="samba-fileprint-security.html" title="Sicurezza di un server di file e di stampa Samba">la sezione chiamata «Sicurezza di un server di file e di stampa Samba»</a>.</p>
</div>
<div class="sect2" title="Accedere a una condivisione Windows">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="ad-integration-windows-share"></a>Accedere a una condivisione Windows</h3>
</div>
</div>
</div>
<p>Ora che il server Samba è parte del dominio Active Directory, è possibile accedere a qualsiasi condivisione server di Windows:</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>Per montare una condivisione file di Windows, in un terminale digitare quanto segue:</p>
<pre class="screen">
<span class="command"><strong>mount.cifs //fs01.example.it/share mount_point</strong></span>
</pre>
<p>È possibile accedere alle condivisioni su computer non facenti parte del dominio AD, ma sarà necessario fornire un nome utente e una password.</p>
</li>
<li class="listitem">
<p>Per montare la condivisione durante la fase di avvio, aggiungere una voce al file <code class="filename">/etc/fstab</code>, per esempio:</p>
<pre class="programlisting">
//192.168.0.5/share /mnt/windows cifs auto,username=steve,password=secret,rw 0 0
</pre>
</li>
<li class="listitem">
<p>Un altro modo per copiare i file da un server Windows consiste nell'usare l'utilità <span class="application"><strong>smbclient</strong></span>. Per elencare i file presenti in una condivisione Windows:</p>
<pre class="screen">
<span class="command"><strong>smbclient //fs01.example.it/share -k -c "ls"</strong></span>
</pre>
</li>
<li class="listitem">
<p>Per copiare un file da una condivisione, digitare:</p>
<pre class="screen">
<span class="command"><strong>smbclient //fs01.example.com/share -k -c "get file.txt"</strong></span>
</pre>
<p>In questo modo si copierà il file <code class="filename">file.txt</code> nella directory corrente.</p>
</li>
<li class="listitem">
<p>Per copiare una file nella condivisione:</p>
<pre class="screen">
<span class="command"><strong>smbclient //fs01.example.it/share -k -c "put /etc/hosts hosts"</strong></span>
</pre>
<p>In questo modo il file <code class="filename">/etc/hosts</code> verrà copiato in <code class="filename">//fs01.example.com/share/hosts</code>.</p>
</li>
<li class="listitem">
<p>L'opzione <span class="emphasis"><em>-c</em></span> usata nei comandi precedenti consente di eseguire il comando <span class="application"><strong>smbclient</strong></span> in una sola volta. Questo è utile all'interno di script e per altre operazioni sui file. Per accedere al prompt <span class="emphasis"><em>smb: \></em></span>, un prompt simile a quello di FTP dove è possibile svolgere normali operazioni su file e directory, digitare:</p>
<pre class="screen">
<span class="command"><strong>smbclient //fs01.example.it/share -k</strong></span>
</pre>
</li>
</ul>
</div>
<div class="note" title="Nota" style="margin-left: 0.5in; margin-right: 0.5in;">
<table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25">
<img alt="[Nota]" src="../../libs/admon/note.png" />
</td>
<th align="left"></th>
</tr>
<tr>
<td align="left" valign="top">
<p>Sostituire tutte le occorrenze di <span class="emphasis"><em>fs01.example.it/share</em></span>, <span class="emphasis"><em>//192.168.0.5/share</em></span>, <span class="emphasis"><em>username=steve,password=secret</em></span> e <span class="emphasis"><em>file.txt</em></span> con l'indirizzo IP del proprio server, il nome nome host, il nome della condivisione, il nome del file e il nome utente e la password dell'utente a cui è consentito accedere alla condivisione.</p>
</td>
</tr>
</table>
</div>
</div>
<div class="sect2" title="Risorse">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="ad-integration-resources"></a>Risorse</h3>
</div>
</div>
</div>
<p>
For more <span class="application"><strong>smbclient</strong></span> options see the man page: <span class="command"><strong>man smbclient</strong></span>, also available
<a class="ulink" href="http://manpages.ubuntu.com/manpages/natty/en/man1/smbclient.1.html" target="_top">online</a>.
</p>
<p>
The <span class="application"><strong>mount.cifs</strong></span>
<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
more detailed information.
</p>
<p>La pagina <a class="ulink" href="https://help.ubuntu.com/community/Samba" target="_top">su Samba</a> della documentazione.</p>
</div>
</div>
<div xmlns="http://www.w3.org/1999/xhtml" class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="samba-dc.html"><img src="../../libs/navig/prev.png" alt="Indietro" /></a> </td>
<td width="20%" align="center">
<a accesskey="u" href="windows-networking.html">
<img src="../../libs/navig/up.png" alt="Risali" />
</a>
</td>
<td width="40%" align="right"> <a accesskey="n" href="backups.html"><img src="../../libs/navig/next.png" alt="Avanti" /></a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Samba come controller di dominio </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">
<img src="../../libs/navig/home.png" alt="Partenza" />
</a>
</td>
<td width="40%" align="right" valign="top"> Capitolo 18. Backup</td>
</tr>
</table>
</div>
</div>
</div>
<div id="page-border-bottom-repeat">
<div id="footer">
<div id="copyright">
Ubuntu e Canonical sono marchi registrati da Canonical Ltd.
</div>
</div>
</div>
<div id="page-border-right-top"></div>
<div id="page-border-right-bottom"></div>
</div>
<div id="page-border-left-top"></div>
<div id="page-border-left-bottom"></div>
</div>
<p></p>
</body>
</html>