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