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