working on creating the 3.0 release tree
[Samba.git] / docs / htmldocs / smbpasswd.8.html
blobda3cb9f601844824271772e08728b70a23f8afbb
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >smbpasswd</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
9 "></HEAD
10 ><BODY
11 CLASS="REFENTRY"
12 BGCOLOR="#FFFFFF"
13 TEXT="#000000"
14 LINK="#0000FF"
15 VLINK="#840084"
16 ALINK="#0000FF"
17 ><H1
18 ><A
19 NAME="SMBPASSWD">smbpasswd</H1
20 ><DIV
21 CLASS="REFNAMEDIV"
22 ><A
23 NAME="AEN5"
24 ></A
25 ><H2
26 >Name</H2
27 >smbpasswd&nbsp;--&nbsp;change a user's SMB password</DIV
28 ><DIV
29 CLASS="REFSYNOPSISDIV"
30 ><A
31 NAME="AEN8"><H2
32 >Synopsis</H2
33 ><P
34 ><B
35 CLASS="COMMAND"
36 >smbpasswd</B
37 > [-a] [-x] [-d] [-e] [-D debuglevel] [-n] [-r &#60;remote machine&#62;] [-R &#60;name resolve order&#62;] [-m] [-U username[%password]] [-h] [-s] [-w pass] [-i] [-L] [username]</P
38 ></DIV
39 ><DIV
40 CLASS="REFSECT1"
41 ><A
42 NAME="AEN27"
43 ></A
44 ><H2
45 >DESCRIPTION</H2
46 ><P
47 >This tool is part of the <A
48 HREF="samba.7.html"
49 TARGET="_top"
50 > Samba</A
51 > suite.</P
52 ><P
53 >The smbpasswd program has several different
54 functions, depending on whether it is run by the <I
55 CLASS="EMPHASIS"
56 >root</I
58 user or not. When run as a normal user it allows the user to change
59 the password used for their SMB sessions on any machines that store
60 SMB passwords. </P
61 ><P
62 >By default (when run with no arguments) it will attempt to
63 change the current user's SMB password on the local machine. This is
64 similar to the way the <B
65 CLASS="COMMAND"
66 >passwd(1)</B
67 > program works.
69 CLASS="COMMAND"
70 >smbpasswd</B
71 > differs from how the passwd program works
72 however in that it is not <I
73 CLASS="EMPHASIS"
74 >setuid root</I
75 > but works in
76 a client-server mode and communicates with a locally running
78 CLASS="COMMAND"
79 >smbd(8)</B
80 >. As a consequence in order for this to
81 succeed the smbd daemon must be running on the local machine. On a
82 UNIX machine the encrypted SMB passwords are usually stored in
83 the <TT
84 CLASS="FILENAME"
85 >smbpasswd(5)</TT
86 > file. </P
87 ><P
88 >When run by an ordinary user with no options, smbpasswd
89 will prompt them for their old SMB password and then ask them
90 for their new password twice, to ensure that the new password
91 was typed correctly. No passwords will be echoed on the screen
92 whilst being typed. If you have a blank SMB password (specified by
93 the string "NO PASSWORD" in the smbpasswd file) then just press
94 the &#60;Enter&#62; key when asked for your old password. </P
95 ><P
96 >smbpasswd can also be used by a normal user to change their
97 SMB password on remote machines, such as Windows NT Primary Domain
98 Controllers. See the (-r) and -U options below. </P
99 ><P
100 >When run by root, smbpasswd allows new users to be added
101 and deleted in the smbpasswd file, as well as allows changes to
102 the attributes of the user in this file to be made. When run by root,
104 CLASS="COMMAND"
105 >smbpasswd</B
106 > accesses the local smbpasswd file
107 directly, thus enabling changes to be made even if smbd is not
108 running. </P
109 ></DIV
110 ><DIV
111 CLASS="REFSECT1"
113 NAME="AEN43"
114 ></A
115 ><H2
116 >OPTIONS</H2
118 ></P
119 ><DIV
120 CLASS="VARIABLELIST"
121 ><DL
122 ><DT
123 >-a</DT
124 ><DD
126 >This option specifies that the username
127 following should be added to the local smbpasswd file, with the
128 new password typed (type &#60;Enter&#62; for the old password). This
129 option is ignored if the username following already exists in
130 the smbpasswd file and it is treated like a regular change
131 password command. Note that the default passdb backends require
132 the user to already exist in the system password file (usually
134 CLASS="FILENAME"
135 >/etc/passwd</TT
136 >), else the request to add the
137 user will fail. </P
139 >This option is only available when running smbpasswd
140 as root. </P
141 ></DD
142 ><DT
143 >-x</DT
144 ><DD
146 >This option specifies that the username
147 following should be deleted from the local smbpasswd file.
150 >This option is only available when running smbpasswd as
151 root.</P
152 ></DD
153 ><DT
154 >-d</DT
155 ><DD
157 >This option specifies that the username following
158 should be <TT
159 CLASS="CONSTANT"
160 >disabled</TT
161 > in the local smbpasswd
162 file. This is done by writing a <TT
163 CLASS="CONSTANT"
164 >'D'</TT
165 > flag
166 into the account control space in the smbpasswd file. Once this
167 is done all attempts to authenticate via SMB using this username
168 will fail. </P
170 >If the smbpasswd file is in the 'old' format (pre-Samba 2.0
171 format) there is no space in the user's password entry to write
172 this information and the command will FAIL. See <B
173 CLASS="COMMAND"
174 >smbpasswd(5)
176 > for details on the 'old' and new password file formats.
179 >This option is only available when running smbpasswd as
180 root.</P
181 ></DD
182 ><DT
183 >-e</DT
184 ><DD
186 >This option specifies that the username following
187 should be <TT
188 CLASS="CONSTANT"
189 >enabled</TT
190 > in the local smbpasswd file,
191 if the account was previously disabled. If the account was not
192 disabled this option has no effect. Once the account is enabled then
193 the user will be able to authenticate via SMB once again. </P
195 >If the smbpasswd file is in the 'old' format, then <B
196 CLASS="COMMAND"
197 > smbpasswd</B
198 > will FAIL to enable the account.
199 See <B
200 CLASS="COMMAND"
201 >smbpasswd (5)</B
202 > for
203 details on the 'old' and new password file formats. </P
205 >This option is only available when running smbpasswd as root.
207 ></DD
208 ><DT
209 >-D debuglevel</DT
210 ><DD
212 ><TT
213 CLASS="REPLACEABLE"
215 >debuglevel</I
216 ></TT
217 > is an integer
218 from 0 to 10. The default value if this parameter is not specified
219 is zero. </P
221 >The higher this value, the more detail will be logged to the
222 log files about the activities of smbpasswd. At level 0, only
223 critical errors and serious warnings will be logged. </P
225 >Levels above 1 will generate considerable amounts of log
226 data, and should only be used when investigating a problem. Levels
227 above 3 are designed for use only by developers and generate
228 HUGE amounts of log data, most of which is extremely cryptic.
230 ></DD
231 ><DT
232 >-n</DT
233 ><DD
235 >This option specifies that the username following
236 should have their password set to null (i.e. a blank password) in
237 the local smbpasswd file. This is done by writing the string "NO
238 PASSWORD" as the first part of the first password stored in the
239 smbpasswd file. </P
241 >Note that to allow users to logon to a Samba server once
242 the password has been set to "NO PASSWORD" in the smbpasswd
243 file the administrator must set the following parameter in the [global]
244 section of the <TT
245 CLASS="FILENAME"
246 >smb.conf</TT
247 > file : </P
250 CLASS="COMMAND"
251 >null passwords = yes</B
252 ></P
254 >This option is only available when running smbpasswd as
255 root.</P
256 ></DD
257 ><DT
258 >-r remote machine name</DT
259 ><DD
261 >This option allows a user to specify what machine
262 they wish to change their password on. Without this parameter
263 smbpasswd defaults to the local host. The <TT
264 CLASS="REPLACEABLE"
266 >remote
267 machine name</I
268 ></TT
269 > is the NetBIOS name of the SMB/CIFS
270 server to contact to attempt the password change. This name is
271 resolved into an IP address using the standard name resolution
272 mechanism in all programs of the Samba suite. See the <TT
273 CLASS="PARAMETER"
275 >-R
276 name resolve order</I
277 ></TT
278 > parameter for details on changing
279 this resolving mechanism. </P
281 >The username whose password is changed is that of the
282 current UNIX logged on user. See the <TT
283 CLASS="PARAMETER"
285 >-U username</I
286 ></TT
288 parameter for details on changing the password for a different
289 username. </P
291 >Note that if changing a Windows NT Domain password the
292 remote machine specified must be the Primary Domain Controller for
293 the domain (Backup Domain Controllers only have a read-only
294 copy of the user account database and will not allow the password
295 change).</P
298 CLASS="EMPHASIS"
299 >Note</I
300 > that Windows 95/98 do not have
301 a real password database so it is not possible to change passwords
302 specifying a Win95/98 machine as remote machine target. </P
303 ></DD
304 ><DT
305 >-R name resolve order</DT
306 ><DD
308 >This option allows the user of smbpasswd to determine
309 what name resolution services to use when looking up the NetBIOS
310 name of the host being connected to. </P
312 >The options are :"lmhosts", "host", "wins" and "bcast". They
313 cause names to be resolved as follows : </P
315 ></P
316 ><UL
317 ><LI
319 ><TT
320 CLASS="CONSTANT"
321 >lmhosts</TT
322 > : Lookup an IP
323 address in the Samba lmhosts file. If the line in lmhosts has
324 no name type attached to the NetBIOS name (see the <A
325 HREF="lmhosts.5.html"
326 TARGET="_top"
327 >lmhosts(5)</A
328 > for details) then
329 any name type matches for lookup.</P
330 ></LI
331 ><LI
333 ><TT
334 CLASS="CONSTANT"
335 >host</TT
336 > : Do a standard host
337 name to IP address resolution, using the system <TT
338 CLASS="FILENAME"
339 >/etc/hosts
340 </TT
341 >, NIS, or DNS lookups. This method of name resolution
342 is operating system depended for instance on IRIX or Solaris this
343 may be controlled by the <TT
344 CLASS="FILENAME"
345 >/etc/nsswitch.conf</TT
347 file). Note that this method is only used if the NetBIOS name
348 type being queried is the 0x20 (server) name type, otherwise
349 it is ignored.</P
350 ></LI
351 ><LI
353 ><TT
354 CLASS="CONSTANT"
355 >wins</TT
356 > : Query a name with
357 the IP address listed in the <TT
358 CLASS="PARAMETER"
360 >wins server</I
361 ></TT
363 parameter. If no WINS server has been specified this method
364 will be ignored.</P
365 ></LI
366 ><LI
368 ><TT
369 CLASS="CONSTANT"
370 >bcast</TT
371 > : Do a broadcast on
372 each of the known local interfaces listed in the
374 CLASS="PARAMETER"
376 >interfaces</I
377 ></TT
378 > parameter. This is the least
379 reliable of the name resolution methods as it depends on the
380 target host being on a locally connected subnet.</P
381 ></LI
382 ></UL
384 >The default order is <B
385 CLASS="COMMAND"
386 >lmhosts, host, wins, bcast</B
388 and without this parameter or any entry in the
390 CLASS="FILENAME"
391 >smb.conf</TT
392 > file the name resolution methods will
393 be attempted in this order. </P
394 ></DD
395 ><DT
396 >-m</DT
397 ><DD
399 >This option tells smbpasswd that the account
400 being changed is a MACHINE account. Currently this is used
401 when Samba is being used as an NT Primary Domain Controller.</P
403 >This option is only available when running smbpasswd as root.
405 ></DD
406 ><DT
407 >-U username</DT
408 ><DD
410 >This option may only be used in conjunction
411 with the <TT
412 CLASS="PARAMETER"
414 >-r</I
415 ></TT
416 > option. When changing
417 a password on a remote machine it allows the user to specify
418 the user name on that machine whose password will be changed. It
419 is present to allow users who have different user names on
420 different systems to change these passwords. </P
421 ></DD
422 ><DT
423 >-h</DT
424 ><DD
426 >This option prints the help string for <B
427 CLASS="COMMAND"
428 > smbpasswd</B
429 >, selecting the correct one for running as root
430 or as an ordinary user. </P
431 ></DD
432 ><DT
433 >-s</DT
434 ><DD
436 >This option causes smbpasswd to be silent (i.e.
437 not issue prompts) and to read its old and new passwords from
438 standard input, rather than from <TT
439 CLASS="FILENAME"
440 >/dev/tty</TT
442 (like the <B
443 CLASS="COMMAND"
444 >passwd(1)</B
445 > program does). This option
446 is to aid people writing scripts to drive smbpasswd</P
447 ></DD
448 ><DT
449 >-w password</DT
450 ><DD
452 >This parameter is only available if Samba
453 has been configured to use the experimental
455 CLASS="COMMAND"
456 >--with-ldapsam</B
457 > option. The <TT
458 CLASS="PARAMETER"
460 >-w</I
461 ></TT
463 switch is used to specify the password to be used with the
465 HREF="smb.conf.5.html#LDAPADMINDN"
466 TARGET="_top"
467 ><TT
468 CLASS="PARAMETER"
470 >ldap admin
471 dn</I
472 ></TT
473 ></A
474 >. Note that the password is stored in
475 the <TT
476 CLASS="FILENAME"
477 >private/secrets.tdb</TT
478 > and is keyed off
479 of the admin's DN. This means that if the value of <TT
480 CLASS="PARAMETER"
482 >ldap
483 admin dn</I
484 ></TT
485 > ever changes, the password will need to be
486 manually updated as well.
488 ></DD
489 ><DT
490 >-i</DT
491 ><DD
493 >This option tells smbpasswd that the account
494 being changed is an interdomain trust account. Currently this is used
495 when Samba is being used as an NT Primary Domain Controller.
496 The account contains the info about another trusted domain.</P
498 >This option is only available when running smbpasswd as root.
500 ></DD
501 ><DT
502 >-L</DT
503 ><DD
505 >Run in local mode.</P
506 ></DD
507 ><DT
508 >username</DT
509 ><DD
511 >This specifies the username for all of the
513 CLASS="EMPHASIS"
514 >root only</I
515 > options to operate on. Only root
516 can specify this parameter as only root has the permission needed
517 to modify attributes directly in the local smbpasswd file.
519 ></DD
520 ></DL
521 ></DIV
522 ></DIV
523 ><DIV
524 CLASS="REFSECT1"
526 NAME="AEN173"
527 ></A
528 ><H2
529 >NOTES</H2
531 >Since <B
532 CLASS="COMMAND"
533 >smbpasswd</B
534 > works in client-server
535 mode communicating with a local smbd for a non-root user then
536 the smbd daemon must be running for this to work. A common problem
537 is to add a restriction to the hosts that may access the <B
538 CLASS="COMMAND"
539 > smbd</B
540 > running on the local machine by specifying a
542 CLASS="PARAMETER"
544 >allow hosts</I
545 ></TT
546 > or <TT
547 CLASS="PARAMETER"
549 >deny hosts</I
550 ></TT
552 entry in the <TT
553 CLASS="FILENAME"
554 >smb.conf</TT
555 > file and neglecting to
556 allow "localhost" access to the smbd. </P
558 >In addition, the smbpasswd command is only useful if Samba
559 has been set up to use encrypted passwords. See the file
561 CLASS="FILENAME"
562 >ENCRYPTION.txt</TT
563 > in the docs directory for details
564 on how to do this. </P
565 ></DIV
566 ><DIV
567 CLASS="REFSECT1"
569 NAME="AEN183"
570 ></A
571 ><H2
572 >VERSION</H2
574 >This man page is correct for version 3.0 of
575 the Samba suite.</P
576 ></DIV
577 ><DIV
578 CLASS="REFSECT1"
580 NAME="AEN186"
581 ></A
582 ><H2
583 >SEE ALSO</H2
586 HREF="smbpasswd.5.html"
587 TARGET="_top"
588 ><TT
589 CLASS="FILENAME"
590 >smbpasswd(5)</TT
591 ></A
594 HREF="samba.7.html"
595 TARGET="_top"
596 >samba(7)</A
599 ></DIV
600 ><DIV
601 CLASS="REFSECT1"
603 NAME="AEN192"
604 ></A
605 ><H2
606 >AUTHOR</H2
608 >The original Samba software and related utilities
609 were created by Andrew Tridgell. Samba is now developed
610 by the Samba Team as an Open Source project similar
611 to the way the Linux kernel is developed.</P
613 >The original Samba man pages were written by Karl Auer.
614 The man page sources were converted to YODL format (another
615 excellent piece of Open Source software, available at
617 HREF="ftp://ftp.icce.rug.nl/pub/unix/"
618 TARGET="_top"
619 > ftp://ftp.icce.rug.nl/pub/unix/</A
620 >) and updated for the Samba 2.0
621 release by Jeremy Allison. The conversion to DocBook for
622 Samba 2.2 was done by Gerald Carter</P
623 ></DIV
624 ></BODY
625 ></HTML