Docbook XML conversion: faq
[Samba/vl.git] / docs / docbook / manpages / smbpasswd.8.sgml
blob5d475cf08c714c0999b7d068e0ef3d6812521747
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
2 <refentry id="smbpasswd.8">
4 <refmeta>
5 <refentrytitle>smbpasswd</refentrytitle>
6 <manvolnum>8</manvolnum>
7 </refmeta>
10 <refnamediv>
11 <refname>smbpasswd</refname>
12 <refpurpose>change a user's SMB password</refpurpose>
13 </refnamediv>
15 <refsynopsisdiv>
16 <cmdsynopsis>
17 <command>smbpasswd</command>
18 <arg choice="opt">-a</arg>
19 <arg choice="opt">-x</arg>
20 <arg choice="opt">-d</arg>
21 <arg choice="opt">-e</arg>
22 <arg choice="opt">-D debuglevel</arg>
23 <arg choice="opt">-n</arg>
24 <arg choice="opt">-r &lt;remote machine&gt;</arg>
25 <arg choice="opt">-R &lt;name resolve order&gt;</arg>
26 <arg choice="opt">-m</arg>
27 <arg choice="opt">-U username[%password]</arg>
28 <arg choice="opt">-h</arg>
29 <arg choice="opt">-s</arg>
30 <arg choice="opt">-w pass</arg>
31 <arg choice="opt">-i</arg>
32 <arg choice="opt">-L</arg>
33 <arg choice="opt">username</arg>
34 </cmdsynopsis>
35 </refsynopsisdiv>
37 <refsect1>
38 <title>DESCRIPTION</title>
40 <para>This tool is part of the <citerefentry><refentrytitle>Samba</refentrytitle>
41 <manvolnum>7</manvolnum></citerefentry> suite.</para>
43 <para>The smbpasswd program has several different
44 functions, depending on whether it is run by the <emphasis>root</emphasis> user
45 or not. When run as a normal user it allows the user to change
46 the password used for their SMB sessions on any machines that store
47 SMB passwords. </para>
49 <para>By default (when run with no arguments) it will attempt to
50 change the current user's SMB password on the local machine. This is
51 similar to the way the <command>passwd(1)</command> program works. <command>
52 smbpasswd</command> differs from how the passwd program works
53 however in that it is not <emphasis>setuid root</emphasis> but works in
54 a client-server mode and communicates with a
55 locally running <citerefentry><refentrytitle>smbd</refentrytitle>
56 <manvolnum>8</manvolnum></citerefentry>. As a consequence in order for this to
57 succeed the smbd daemon must be running on the local machine. On a
58 UNIX machine the encrypted SMB passwords are usually stored in
59 the <citerefentry><refentrytitle>smbpasswd</refentrytitle>
60 <manvolnum>5</manvolnum></citerefentry> file. </para>
62 <para>When run by an ordinary user with no options, smbpasswd
63 will prompt them for their old SMB password and then ask them
64 for their new password twice, to ensure that the new password
65 was typed correctly. No passwords will be echoed on the screen
66 whilst being typed. If you have a blank SMB password (specified by
67 the string "NO PASSWORD" in the smbpasswd file) then just press
68 the &lt;Enter&gt; key when asked for your old password. </para>
70 <para>smbpasswd can also be used by a normal user to change their
71 SMB password on remote machines, such as Windows NT Primary Domain
72 Controllers. See the (<parameter>-r</parameter>) and <parameter>-U</parameter> options
73 below. </para>
75 <para>When run by root, smbpasswd allows new users to be added
76 and deleted in the smbpasswd file, as well as allows changes to
77 the attributes of the user in this file to be made. When run by root, <command>
78 smbpasswd</command> accesses the local smbpasswd file
79 directly, thus enabling changes to be made even if smbd is not
80 running. </para>
81 </refsect1>
83 <refsect1>
84 <title>OPTIONS</title>
85 <variablelist>
86 <varlistentry>
87 <term>-a</term>
88 <listitem><para>This option specifies that the username
89 following should be added to the local smbpasswd file, with the
90 new password typed (type &lt;Enter&gt; for the old password). This
91 option is ignored if the username following already exists in
92 the smbpasswd file and it is treated like a regular change
93 password command. Note that the default passdb backends require
94 the user to already exist in the system password file (usually
95 <filename>/etc/passwd</filename>), else the request to add the
96 user will fail. </para>
98 <para>This option is only available when running smbpasswd
99 as root. </para></listitem>
100 </varlistentry>
104 <varlistentry>
105 <term>-x</term>
106 <listitem><para>This option specifies that the username
107 following should be deleted from the local smbpasswd file.
108 </para>
110 <para>This option is only available when running smbpasswd as
111 root.</para></listitem>
112 </varlistentry>
116 <varlistentry>
117 <term>-d</term>
118 <listitem><para>This option specifies that the username following
119 should be <constant>disabled</constant> in the local smbpasswd
120 file. This is done by writing a <constant>'D'</constant> flag
121 into the account control space in the smbpasswd file. Once this
122 is done all attempts to authenticate via SMB using this username
123 will fail. </para>
125 <para>If the smbpasswd file is in the 'old' format (pre-Samba 2.0
126 format) there is no space in the user's password entry to write
127 this information and the command will FAIL. See <citerefentry><refentrytitle>smbpasswd</refentrytitle>
128 <manvolnum>5</manvolnum></citerefentry> for details on the 'old' and new password file formats.
129 </para>
131 <para>This option is only available when running smbpasswd as
132 root.</para></listitem>
133 </varlistentry>
136 <varlistentry>
137 <term>-e</term>
138 <listitem><para>This option specifies that the username following
139 should be <constant>enabled</constant> in the local smbpasswd file,
140 if the account was previously disabled. If the account was not
141 disabled this option has no effect. Once the account is enabled then
142 the user will be able to authenticate via SMB once again. </para>
144 <para>If the smbpasswd file is in the 'old' format, then <command>
145 smbpasswd</command> will FAIL to enable the account.
146 See <citerefentry><refentrytitle>smbpasswd</refentrytitle>
147 <manvolnum>5</manvolnum></citerefentry> for
148 details on the 'old' and new password file formats. </para>
150 <para>This option is only available when running smbpasswd as root.
151 </para></listitem>
152 </varlistentry>
156 <varlistentry>
157 <term>-D debuglevel</term>
158 <listitem><para><replaceable>debuglevel</replaceable> is an integer
159 from 0 to 10. The default value if this parameter is not specified
160 is zero. </para>
162 <para>The higher this value, the more detail will be logged to the
163 log files about the activities of smbpasswd. At level 0, only
164 critical errors and serious warnings will be logged. </para>
166 <para>Levels above 1 will generate considerable amounts of log
167 data, and should only be used when investigating a problem. Levels
168 above 3 are designed for use only by developers and generate
169 HUGE amounts of log data, most of which is extremely cryptic.
170 </para></listitem>
171 </varlistentry>
175 <varlistentry>
176 <term>-n</term>
177 <listitem><para>This option specifies that the username following
178 should have their password set to null (i.e. a blank password) in
179 the local smbpasswd file. This is done by writing the string "NO
180 PASSWORD" as the first part of the first password stored in the
181 smbpasswd file. </para>
183 <para>Note that to allow users to logon to a Samba server once
184 the password has been set to "NO PASSWORD" in the smbpasswd
185 file the administrator must set the following parameter in the [global]
186 section of the <filename>smb.conf</filename> file : </para>
188 <para><command>null passwords = yes</command></para>
190 <para>This option is only available when running smbpasswd as
191 root.</para></listitem>
192 </varlistentry>
196 <varlistentry>
197 <term>-r remote machine name</term>
198 <listitem><para>This option allows a user to specify what machine
199 they wish to change their password on. Without this parameter
200 smbpasswd defaults to the local host. The <replaceable>remote
201 machine name</replaceable> is the NetBIOS name of the SMB/CIFS
202 server to contact to attempt the password change. This name is
203 resolved into an IP address using the standard name resolution
204 mechanism in all programs of the Samba suite. See the <parameter>-R
205 name resolve order</parameter> parameter for details on changing
206 this resolving mechanism. </para>
208 <para>The username whose password is changed is that of the
209 current UNIX logged on user. See the <parameter>-U username</parameter>
210 parameter for details on changing the password for a different
211 username. </para>
213 <para>Note that if changing a Windows NT Domain password the
214 remote machine specified must be the Primary Domain Controller for
215 the domain (Backup Domain Controllers only have a read-only
216 copy of the user account database and will not allow the password
217 change).</para>
219 <para><emphasis>Note</emphasis> that Windows 95/98 do not have
220 a real password database so it is not possible to change passwords
221 specifying a Win95/98 machine as remote machine target. </para>
222 </listitem>
223 </varlistentry>
226 <varlistentry>
227 <term>-R name resolve order</term>
228 <listitem><para>This option allows the user of smbpasswd to determine
229 what name resolution services to use when looking up the NetBIOS
230 name of the host being connected to. </para>
232 <para>The options are :"lmhosts", "host", "wins" and "bcast". They
233 cause names to be resolved as follows: </para>
234 <itemizedlist>
235 <listitem><para><constant>lmhosts</constant>: Lookup an IP
236 address in the Samba lmhosts file. If the line in lmhosts has
237 no name type attached to the NetBIOS name (see the <citerefentry><refentrytitle>lmhosts</refentrytitle>
238 <manvolnum>5</manvolnum></citerefentry> for details) then
239 any name type matches for lookup.</para></listitem>
241 <listitem><para><constant>host</constant>: Do a standard host
242 name to IP address resolution, using the system <filename>/etc/hosts
243 </filename>, NIS, or DNS lookups. This method of name resolution
244 is operating system depended for instance on IRIX or Solaris this
245 may be controlled by the <filename>/etc/nsswitch.conf</filename>
246 file). Note that this method is only used if the NetBIOS name
247 type being queried is the 0x20 (server) name type, otherwise
248 it is ignored.</para></listitem>
250 <listitem><para><constant>wins</constant>: Query a name with
251 the IP address listed in the <parameter>wins server</parameter>
252 parameter. If no WINS server has been specified this method
253 will be ignored.</para></listitem>
255 <listitem><para><constant>bcast</constant>: Do a broadcast on
256 each of the known local interfaces listed in the
257 <parameter>interfaces</parameter> parameter. This is the least
258 reliable of the name resolution methods as it depends on the
259 target host being on a locally connected subnet.</para></listitem>
260 </itemizedlist>
262 <para>The default order is <command>lmhosts, host, wins, bcast</command>
263 and without this parameter or any entry in the <citerefentry><refentrytitle>smb.conf</refentrytitle>
264 <manvolnum>5</manvolnum></citerefentry> file the name resolution methods will
265 be attempted in this order. </para></listitem>
266 </varlistentry>
269 <varlistentry>
270 <term>-m</term>
271 <listitem><para>This option tells smbpasswd that the account
272 being changed is a MACHINE account. Currently this is used
273 when Samba is being used as an NT Primary Domain Controller.</para>
275 <para>This option is only available when running smbpasswd as root.
276 </para></listitem>
277 </varlistentry>
280 <varlistentry>
281 <term>-U username</term>
282 <listitem><para>This option may only be used in conjunction
283 with the <parameter>-r</parameter> option. When changing
284 a password on a remote machine it allows the user to specify
285 the user name on that machine whose password will be changed. It
286 is present to allow users who have different user names on
287 different systems to change these passwords. </para></listitem>
288 </varlistentry>
291 <varlistentry>
292 <term>-h</term>
293 <listitem><para>This option prints the help string for <command>
294 smbpasswd</command>, selecting the correct one for running as root
295 or as an ordinary user. </para></listitem>
296 </varlistentry>
299 <varlistentry>
300 <term>-s</term>
301 <listitem><para>This option causes smbpasswd to be silent (i.e.
302 not issue prompts) and to read its old and new passwords from
303 standard input, rather than from <filename>/dev/tty</filename>
304 (like the <command>passwd(1)</command> program does). This option
305 is to aid people writing scripts to drive smbpasswd</para>
306 </listitem>
307 </varlistentry>
310 <varlistentry>
311 <term>-w password</term>
312 <listitem><para>This parameter is only available if Samba
313 has been configured to use the experimental
314 <command>--with-ldapsam</command> option. The <parameter>-w</parameter>
315 switch is used to specify the password to be used with the
316 <ulink url="smb.conf.5.html#LDAPADMINDN"><parameter>ldap admin
317 dn</parameter></ulink>. Note that the password is stored in
318 the <filename>secrets.tdb</filename> and is keyed off
319 of the admin's DN. This means that if the value of <parameter>ldap
320 admin dn</parameter> ever changes, the password will need to be
321 manually updated as well.
322 </para>
323 </listitem>
324 </varlistentry>
326 <varlistentry>
327 <term>-i</term>
328 <listitem><para>This option tells smbpasswd that the account
329 being changed is an interdomain trust account. Currently this is used
330 when Samba is being used as an NT Primary Domain Controller.
331 The account contains the info about another trusted domain.</para>
333 <para>This option is only available when running smbpasswd as root.
334 </para></listitem>
335 </varlistentry>
337 <varlistentry>
338 <term>-L</term>
339 <listitem><para>Run in local mode.</para></listitem>
340 </varlistentry>
342 <varlistentry>
343 <term>username</term>
344 <listitem><para>This specifies the username for all of the
345 <emphasis>root only</emphasis> options to operate on. Only root
346 can specify this parameter as only root has the permission needed
347 to modify attributes directly in the local smbpasswd file.
348 </para></listitem>
349 </varlistentry>
350 </variablelist>
351 </refsect1>
354 <refsect1>
355 <title>NOTES</title>
357 <para>Since <command>smbpasswd</command> works in client-server
358 mode communicating with a local smbd for a non-root user then
359 the smbd daemon must be running for this to work. A common problem
360 is to add a restriction to the hosts that may access the <command>
361 smbd</command> running on the local machine by specifying either <parameter>allow
362 hosts</parameter> or <parameter>deny hosts</parameter> entry in
363 the <citerefentry><refentrytitle>smb.conf</refentrytitle>
364 <manvolnum>5</manvolnum></citerefentry> file and neglecting to
365 allow "localhost" access to the smbd. </para>
367 <para>In addition, the smbpasswd command is only useful if Samba
368 has been set up to use encrypted passwords. See the document <ulink url="pwencrypt.html">
369 "LanMan and NT Password Encryption in Samba"</ulink> in the docs directory for details
370 on how to do this. </para>
371 </refsect1>
374 <refsect1>
375 <title>VERSION</title>
377 <para>This man page is correct for version 3.0 of the Samba suite.</para>
378 </refsect1>
380 <refsect1>
381 <title>SEE ALSO</title>
382 <para><citerefentry><refentrytitle>smbpasswd</refentrytitle>
383 <manvolnum>5</manvolnum></citerefentry>, <citerefentry><refentrytitle>Samba</refentrytitle>
384 <manvolnum>7</manvolnum></citerefentry>.</para>
385 </refsect1>
387 <refsect1>
388 <title>AUTHOR</title>
390 <para>The original Samba software and related utilities
391 were created by Andrew Tridgell. Samba is now developed
392 by the Samba Team as an Open Source project similar
393 to the way the Linux kernel is developed.</para>
395 <para>The original Samba man pages were written by Karl Auer.
396 The man page sources were converted to YODL format (another
397 excellent piece of Open Source software, available at <ulink url="ftp://ftp.icce.rug.nl/pub/unix/">
398 ftp://ftp.icce.rug.nl/pub/unix/</ulink>) and updated for the Samba 2.0
399 release by Jeremy Allison. The conversion to DocBook for
400 Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2
401 for Samba 3.0 was done by Alexander Bokovoy.</para>
402 </refsect1>
404 </refentry>