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