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