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">
6 <refentrytitle>smbpasswd</refentrytitle>
7 <manvolnum>8</manvolnum>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">System Administration tools</refmiscinfo>
10 <refmiscinfo class="version">&doc.version;</refmiscinfo>
15 <refname>smbpasswd</refname>
16 <refpurpose>change a user's SMB password</refpurpose>
21 <command>smbpasswd</command>
22 <arg choice="opt">-a</arg>
23 <arg choice="opt">-c <config file></arg>
24 <arg choice="opt">-x</arg>
25 <arg choice="opt">-d</arg>
26 <arg choice="opt">-e</arg>
27 <arg choice="opt">-D debuglevel</arg>
28 <arg choice="opt">-n</arg>
29 <arg choice="opt">-r <remote machine></arg>
30 <arg choice="opt">-R <name resolve order></arg>
31 <arg choice="opt">-m</arg>
32 <arg choice="opt">-U username[%password]</arg>
33 <arg choice="opt">-h</arg>
34 <arg choice="opt">-s</arg>
35 <arg choice="opt">-w pass</arg>
36 <arg choice="opt">-W</arg>
37 <arg choice="opt">-i</arg>
38 <arg choice="opt">-L</arg>
39 <arg choice="opt">username</arg>
44 <title>DESCRIPTION</title>
46 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
47 <manvolnum>7</manvolnum></citerefentry> suite.</para>
49 <para>The smbpasswd program has several different
50 functions, depending on whether it is run by the <emphasis>root</emphasis> user
51 or not. When run as a normal user it allows the user to change
52 the password used for their SMB sessions on any machines that store
53 SMB passwords. </para>
55 <para>By default (when run with no arguments) it will attempt to
56 change the current user's SMB password on the local machine. This is
57 similar to the way the <command>passwd(1)</command> program works. <command>
58 smbpasswd</command> differs from how the passwd program works
59 however in that it is not <emphasis>setuid root</emphasis> but works in
60 a client-server mode and communicates with a
61 locally running <citerefentry><refentrytitle>smbd</refentrytitle>
62 <manvolnum>8</manvolnum></citerefentry>. As a consequence in order for this to
63 succeed the smbd daemon must be running on the local machine. On a
64 UNIX machine the encrypted SMB passwords are usually stored in
65 the default passdb backend.</para>
67 <para>When run by an ordinary user with no options, smbpasswd
68 will prompt them for their old SMB password and then ask them
69 for their new password twice, to ensure that the new password
70 was typed correctly. No passwords will be echoed on the screen
71 whilst being typed. If you have a blank SMB password (specified by
72 the string "NO PASSWORD" in the smbpasswd file) then just press
73 the <Enter> key when asked for your old password. </para>
75 <para>smbpasswd can also be used by a normal user to change their
76 SMB password on remote machines, such as Windows NT Primary Domain
77 Controllers. See the (<parameter>-r</parameter>) and <parameter>-U</parameter> options
80 <para>When run by root, smbpasswd allows new users to be added
81 and deleted in the smbpasswd file, as well as allows changes to
82 the attributes of the user in this file to be made. When run by root, <command>
83 smbpasswd</command> accesses the local smbpasswd file
84 directly, thus enabling changes to be made even if smbd is not
89 <title>OPTIONS</title>
94 This option specifies that the username following should be added to the local smbpasswd file, with the new
95 password typed (type <Enter> for the old password). This option is ignored if the username following
96 already exists in the smbpasswd file and it is treated like a regular change password command. Note that the
97 default passdb backends require the user to already exist in the system password file (usually
98 <filename>/etc/passwd</filename>), else the request to add the user will fail.
101 <para>This option is only available when running smbpasswd
102 as root. </para></listitem>
109 This option can be used to specify the path and file name of the &smb.conf; configuration file when it
110 is important to use other than the default file and / or location.
118 This option specifies that the username following should be deleted from the local smbpasswd file.
122 This option is only available when running smbpasswd as root.
130 <listitem><para>This option specifies that the username following
131 should be <constant>disabled</constant> in the local smbpasswd
132 file. This is done by writing a <constant>'D'</constant> flag
133 into the account control space in the smbpasswd file. Once this
134 is done all attempts to authenticate via SMB using this username
137 <para>If the smbpasswd file is in the 'old' format (pre-Samba 2.0
138 format) there is no space in the user's password entry to write
139 this information and the command will FAIL. See <citerefentry><refentrytitle>smbpasswd</refentrytitle>
140 <manvolnum>5</manvolnum></citerefentry> for details on the 'old' and new password file formats.
143 <para>This option is only available when running smbpasswd as
144 root.</para></listitem>
150 <listitem><para>This option specifies that the username following
151 should be <constant>enabled</constant> in the local smbpasswd file,
152 if the account was previously disabled. If the account was not
153 disabled this option has no effect. Once the account is enabled then
154 the user will be able to authenticate via SMB once again. </para>
156 <para>If the smbpasswd file is in the 'old' format, then <command>
157 smbpasswd</command> will FAIL to enable the account.
158 See <citerefentry><refentrytitle>smbpasswd</refentrytitle>
159 <manvolnum>5</manvolnum></citerefentry> for
160 details on the 'old' and new password file formats. </para>
162 <para>This option is only available when running smbpasswd as root.
169 <term>-D debuglevel</term>
170 <listitem><para><replaceable>debuglevel</replaceable> is an integer
171 from 0 to 10. The default value if this parameter is not specified
174 <para>The higher this value, the more detail will be logged to the
175 log files about the activities of smbpasswd. At level 0, only
176 critical errors and serious warnings will be logged. </para>
178 <para>Levels above 1 will generate considerable amounts of log
179 data, and should only be used when investigating a problem. Levels
180 above 3 are designed for use only by developers and generate
181 HUGE amounts of log data, most of which is extremely cryptic.
189 <listitem><para>This option specifies that the username following
190 should have their password set to null (i.e. a blank password) in
191 the local smbpasswd file. This is done by writing the string "NO
192 PASSWORD" as the first part of the first password stored in the
193 smbpasswd file. </para>
195 <para>Note that to allow users to logon to a Samba server once
196 the password has been set to "NO PASSWORD" in the smbpasswd
197 file the administrator must set the following parameter in the [global]
198 section of the <filename>smb.conf</filename> file : </para>
200 <para><command>null passwords = yes</command></para>
202 <para>This option is only available when running smbpasswd as
203 root.</para></listitem>
209 <term>-r remote machine name</term>
210 <listitem><para>This option allows a user to specify what machine
211 they wish to change their password on. Without this parameter
212 smbpasswd defaults to the local host. The <replaceable>remote
213 machine name</replaceable> is the NetBIOS name of the SMB/CIFS
214 server to contact to attempt the password change. This name is
215 resolved into an IP address using the standard name resolution
216 mechanism in all programs of the Samba suite. See the <parameter>-R
217 name resolve order</parameter> parameter for details on changing
218 this resolving mechanism. </para>
220 <para>The username whose password is changed is that of the
221 current UNIX logged on user. See the <parameter>-U username</parameter>
222 parameter for details on changing the password for a different
225 <para>Note that if changing a Windows NT Domain password the
226 remote machine specified must be the Primary Domain Controller for
227 the domain (Backup Domain Controllers only have a read-only
228 copy of the user account database and will not allow the password
231 <para><emphasis>Note</emphasis> that Windows 95/98 do not have
232 a real password database so it is not possible to change passwords
233 specifying a Win95/98 machine as remote machine target. </para>
239 <term>-R name resolve order</term>
240 <listitem><para>This option allows the user of smbpasswd to determine
241 what name resolution services to use when looking up the NetBIOS
242 name of the host being connected to. </para>
244 <para>The options are :"lmhosts", "host", "wins" and "bcast". They
245 cause names to be resolved as follows: </para>
247 <listitem><para><constant>lmhosts</constant>: Lookup an IP
248 address in the Samba lmhosts file. If the line in lmhosts has
249 no name type attached to the NetBIOS name (see the <citerefentry><refentrytitle>lmhosts</refentrytitle>
250 <manvolnum>5</manvolnum></citerefentry> for details) then
251 any name type matches for lookup.</para></listitem>
253 <listitem><para><constant>host</constant>: Do a standard host
254 name to IP address resolution, using the system <filename>/etc/hosts
255 </filename>, NIS, or DNS lookups. This method of name resolution
256 is operating system depended for instance on IRIX or Solaris this
257 may be controlled by the <filename>/etc/nsswitch.conf</filename>
258 file). Note that this method is only used if the NetBIOS name
259 type being queried is the 0x20 (server) name type, otherwise
260 it is ignored.</para></listitem>
262 <listitem><para><constant>wins</constant>: Query a name with
263 the IP address listed in the <parameter>wins server</parameter>
264 parameter. If no WINS server has been specified this method
265 will be ignored.</para></listitem>
267 <listitem><para><constant>bcast</constant>: Do a broadcast on
268 each of the known local interfaces listed in the
269 <parameter>interfaces</parameter> parameter. This is the least
270 reliable of the name resolution methods as it depends on the
271 target host being on a locally connected subnet.</para></listitem>
274 <para>The default order is <command>lmhosts, host, wins, bcast</command>
275 and without this parameter or any entry in the <citerefentry><refentrytitle>smb.conf</refentrytitle>
276 <manvolnum>5</manvolnum></citerefentry> file the name resolution methods will
277 be attempted in this order. </para></listitem>
283 <listitem><para>This option tells smbpasswd that the account
284 being changed is a MACHINE account. Currently this is used
285 when Samba is being used as an NT Primary Domain Controller.</para>
287 <para>This option is only available when running smbpasswd as root.
293 <term>-U username</term>
294 <listitem><para>This option may only be used in conjunction
295 with the <parameter>-r</parameter> option. When changing
296 a password on a remote machine it allows the user to specify
297 the user name on that machine whose password will be changed. It
298 is present to allow users who have different user names on
299 different systems to change these passwords. </para></listitem>
305 <listitem><para>This option prints the help string for <command>
306 smbpasswd</command>, selecting the correct one for running as root
307 or as an ordinary user. </para></listitem>
313 <listitem><para>This option causes smbpasswd to be silent (i.e.
314 not issue prompts) and to read its old and new passwords from
315 standard input, rather than from <filename>/dev/tty</filename>
316 (like the <command>passwd(1)</command> program does). This option
317 is to aid people writing scripts to drive smbpasswd</para>
323 <term>-w password</term>
324 <listitem><para>This parameter is only available if Samba
325 has been compiled with LDAP support. The <parameter>-w</parameter>
326 switch is used to specify the password to be used with the
327 <smbconfoption name="ldap admin dn"/>. Note that the password is stored in
328 the <filename>secrets.tdb</filename> and is keyed off
329 of the admin's DN. This means that if the value of <parameter>ldap
330 admin dn</parameter> ever changes, the password will need to be
331 manually updated as well.
338 <listitem><para><command>NOTE: </command> This option is same as "-w"
339 except that the password should be entered using stdin.
341 <para>This parameter is only available if Samba
342 has been compiled with LDAP support. The <parameter>-W</parameter>
343 switch is used to specify the password to be used with the
344 <smbconfoption name="ldap admin dn"/>. Note that the password is stored in
345 the <filename>secrets.tdb</filename> and is keyed off
346 of the admin's DN. This means that if the value of <parameter>ldap
347 admin dn</parameter> ever changes, the password will need to be
348 manually updated as well.
356 <listitem><para>This option tells smbpasswd that the account
357 being changed is an interdomain trust account. Currently this is used
358 when Samba is being used as an NT Primary Domain Controller.
359 The account contains the info about another trusted domain.</para>
361 <para>This option is only available when running smbpasswd as root.
367 <listitem><para>Run in local mode.</para></listitem>
371 <term>username</term>
372 <listitem><para>This specifies the username for all of the
373 <emphasis>root only</emphasis> options to operate on. Only root
374 can specify this parameter as only root has the permission needed
375 to modify attributes directly in the local smbpasswd file.
385 <para>Since <command>smbpasswd</command> works in client-server
386 mode communicating with a local smbd for a non-root user then
387 the smbd daemon must be running for this to work. A common problem
388 is to add a restriction to the hosts that may access the <command>
389 smbd</command> running on the local machine by specifying either <parameter>allow
390 hosts</parameter> or <parameter>deny hosts</parameter> entry in
391 the <citerefentry><refentrytitle>smb.conf</refentrytitle>
392 <manvolnum>5</manvolnum></citerefentry> file and neglecting to
393 allow "localhost" access to the smbd. </para>
395 <para>In addition, the smbpasswd command is only useful if Samba
396 has been set up to use encrypted passwords. </para>
401 <title>VERSION</title>
403 <para>This man page is part of version &doc.version; of the Samba suite.</para>
407 <title>SEE ALSO</title>
408 <para><citerefentry><refentrytitle>smbpasswd</refentrytitle>
409 <manvolnum>5</manvolnum></citerefentry>, <citerefentry><refentrytitle>Samba</refentrytitle>
410 <manvolnum>7</manvolnum></citerefentry>.</para>
414 <title>AUTHOR</title>
416 <para>The original Samba software and related utilities
417 were created by Andrew Tridgell. Samba is now developed
418 by the Samba Team as an Open Source project similar
419 to the way the Linux kernel is developed.</para>