large set of updates from Richard Hellier <rlh@lsil.com>.
[Samba.git] / docs / htmldocs / smbpasswd.8.html
blobf48754163b991b2fe4a6e7f410db6a57d675601a
1 <HTML
2 ><HEAD
3 ><TITLE
4 >smbpasswd</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.57"></HEAD
8 ><BODY
9 CLASS="REFENTRY"
10 BGCOLOR="#FFFFFF"
11 TEXT="#000000"
12 LINK="#0000FF"
13 VLINK="#840084"
14 ALINK="#0000FF"
15 ><H1
16 ><A
17 NAME="SMBPASSWD"
18 >smbpasswd</A
19 ></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"
32 ></A
33 ><H2
34 >Synopsis</H2
35 ><P
36 ><B
37 CLASS="COMMAND"
38 >smbpasswd</B
39 > [-a] [-x] [-d] [-e] [-D debuglevel] [-n] [-r &#60;remote machine&#62;] [-R &#60;name resolve order&#62;] [-m] [-j DOMAIN] [-U username] [-h] [-s] [username]</P
40 ></DIV
41 ><DIV
42 CLASS="REFSECT1"
43 ><A
44 NAME="AEN25"
45 ></A
46 ><H2
47 >DESCRIPTION</H2
48 ><P
49 >This tool is part of the <A
50 HREF="samba.7.html"
51 TARGET="_top"
52 > Samba</A
53 > suite.</P
54 ><P
55 >The smbpasswd program has several different
56 functions, depending on whether it is run by the <EM
57 >root</EM
59 user or not. When run as a normal user it allows the user to change
60 the password used for their SMB sessions on any machines that store
61 SMB passwords. </P
62 ><P
63 >By default (when run with no arguments) it will attempt to
64 change the current user's SMB password on the local machine. This is
65 similar to the way the <B
66 CLASS="COMMAND"
67 >passwd(1)</B
68 > program works.
70 CLASS="COMMAND"
71 >smbpasswd</B
72 > differs from how the passwd program works
73 however in that it is not <EM
74 >setuid root</EM
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="AEN41"
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 user to be added must already exist
132 in the system password file (usually <TT
133 CLASS="FILENAME"
134 >/etc/passwd</TT
136 else the request to add the user will fail. </P
138 >This option is only available when running smbpasswd
139 as root. </P
140 ></DD
141 ><DT
142 >-x</DT
143 ><DD
145 >This option specifies that the username
146 following should be deleted from the local smbpasswd file.
149 >This option is only available when running smbpasswd as
150 root.</P
151 ></DD
152 ><DT
153 >-d</DT
154 ><DD
156 >This option specifies that the username following
157 should be <TT
158 CLASS="CONSTANT"
159 >disabled</TT
160 > in the local smbpasswd
161 file. This is done by writing a <TT
162 CLASS="CONSTANT"
163 >'D'</TT
164 > flag
165 into the account control space in the smbpasswd file. Once this
166 is done all attempts to authenticate via SMB using this username
167 will fail. </P
169 >If the smbpasswd file is in the 'old' format (pre-Samba 2.0
170 format) there is no space in the user's password entry to write
171 this information and so the user is disabled by writing 'X' characters
172 into the password space in the smbpasswd file. 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 prompt for a new password for this user,
199 otherwise the account will be enabled by removing the <TT
200 CLASS="CONSTANT"
201 >'D'
202 </TT
203 > flag from account control space in the <TT
204 CLASS="FILENAME"
205 > smbpasswd</TT
206 > file. See <B
207 CLASS="COMMAND"
208 >smbpasswd (5)</B
209 > for
210 details on the 'old' and new password file formats. </P
212 >This option is only available when running smbpasswd as root.
214 ></DD
215 ><DT
216 >-D debuglevel</DT
217 ><DD
219 ><TT
220 CLASS="REPLACEABLE"
222 >debuglevel</I
223 ></TT
224 > is an integer
225 from 0 to 10. The default value if this parameter is not specified
226 is zero. </P
228 >The higher this value, the more detail will be logged to the
229 log files about the activities of smbpasswd. At level 0, only
230 critical errors and serious warnings will be logged. </P
232 >Levels above 1 will generate considerable amounts of log
233 data, and should only be used when investigating a problem. Levels
234 above 3 are designed for use only by developers and generate
235 HUGE amounts of log data, most of which is extremely cryptic.
237 ></DD
238 ><DT
239 >-n</DT
240 ><DD
242 >This option specifies that the username following
243 should have their password set to null (i.e. a blank password) in
244 the local smbpasswd file. This is done by writing the string "NO
245 PASSWORD" as the first part of the first password stored in the
246 smbpasswd file. </P
248 >Note that to allow users to logon to a Samba server once
249 the password has been set to "NO PASSWORD" in the smbpasswd
250 file the administrator must set the following parameter in the [global]
251 section of the <TT
252 CLASS="FILENAME"
253 >smb.conf</TT
254 > file : </P
257 CLASS="COMMAND"
258 >null passwords = yes</B
259 ></P
261 >This option is only available when running smbpasswd as
262 root.</P
263 ></DD
264 ><DT
265 >-r remote machine name</DT
266 ><DD
268 >This option allows a user to specify what machine
269 they wish to change their password on. Without this parameter
270 smbpasswd defaults to the local host. The <TT
271 CLASS="REPLACEABLE"
273 >remote
274 machine name</I
275 ></TT
276 > is the NetBIOS name of the SMB/CIFS
277 server to contact to attempt the password change. This name is
278 resolved into an IP address using the standard name resolution
279 mechanism in all programs of the Samba suite. See the <TT
280 CLASS="PARAMETER"
282 >-R
283 name resolve order</I
284 ></TT
285 > parameter for details on changing
286 this resolving mechanism. </P
288 >The username whose password is changed is that of the
289 current UNIX logged on user. See the <TT
290 CLASS="PARAMETER"
292 >-U username</I
293 ></TT
295 parameter for details on changing the password for a different
296 username. </P
298 >Note that if changing a Windows NT Domain password the
299 remote machine specified must be the Primary Domain Controller for
300 the domain (Backup Domain Controllers only have a read-only
301 copy of the user account database and will not allow the password
302 change).</P
304 ><EM
305 >Note</EM
306 > that Windows 95/98 do not have
307 a real password database so it is not possible to change passwords
308 specifying a Win95/98 machine as remote machine target. </P
309 ></DD
310 ><DT
311 >-R name resolve order</DT
312 ><DD
314 >This option allows the user of smbpasswd to determine
315 what name resolution services to use when looking up the NetBIOS
316 name of the host being connected to. </P
318 >The options are :"lmhosts", "host", "wins" and "bcast". They cause
319 names to be resolved as follows : </P
321 ></P
322 ><UL
323 ><LI
325 ><TT
326 CLASS="CONSTANT"
327 >lmhosts</TT
328 > : Lookup an IP
329 address in the Samba lmhosts file. If the line in lmhosts has
330 no name type attached to the NetBIOS name (see the <A
331 HREF="lmhosts.5.html"
332 TARGET="_top"
333 >lmhosts(5)</A
334 > for details) then
335 any name type matches for lookup.</P
336 ></LI
337 ><LI
339 ><TT
340 CLASS="CONSTANT"
341 >host</TT
342 > : Do a standard host
343 name to IP address resolution, using the system <TT
344 CLASS="FILENAME"
345 >/etc/hosts
346 </TT
347 >, NIS, or DNS lookups. This method of name resolution
348 is operating system depended for instance on IRIX or Solaris this
349 may be controlled by the <TT
350 CLASS="FILENAME"
351 >/etc/nsswitch.conf</TT
353 file). Note that this method is only used if the NetBIOS name
354 type being queried is the 0x20 (server) name type, otherwise
355 it is ignored.</P
356 ></LI
357 ><LI
359 ><TT
360 CLASS="CONSTANT"
361 >wins</TT
362 > : Query a name with
363 the IP address listed in the <TT
364 CLASS="PARAMETER"
366 >wins server</I
367 ></TT
369 parameter. If no WINS server has been specified this method
370 will be ignored.</P
371 ></LI
372 ><LI
374 ><TT
375 CLASS="CONSTANT"
376 >bcast</TT
377 > : Do a broadcast on
378 each of the known local interfaces listed in the
380 CLASS="PARAMETER"
382 >interfaces</I
383 ></TT
384 > parameter. This is the least
385 reliable of the name resolution methods as it depends on the
386 target host being on a locally connected subnet.</P
387 ></LI
388 ></UL
390 >The default order is <B
391 CLASS="COMMAND"
392 >lmhosts, host, wins, bcast</B
394 and without this parameter or any entry in the
396 CLASS="FILENAME"
397 >smb.conf</TT
398 > file the name resolution methods will
399 be attempted in this order. </P
400 ></DD
401 ><DT
402 >-m</DT
403 ><DD
405 >This option tells smbpasswd that the account
406 being changed is a MACHINE account. Currently this is used
407 when Samba is being used as an NT Primary Domain Controller.</P
409 >This option is only available when running smbpasswd as root.
411 ></DD
412 ><DT
413 >-j DOMAIN</DT
414 ><DD
416 >This option is used to add a Samba server
417 into a Windows NT Domain, as a Domain member capable of authenticating
418 user accounts to any Domain Controller in the same way as a Windows
419 NT Server. See the <B
420 CLASS="COMMAND"
421 >security = domain</B
422 > option in
423 the <TT
424 CLASS="FILENAME"
425 >smb.conf(5)</TT
426 > man page. </P
428 >In order to be used in this way, the Administrator for
429 the Windows NT Domain must have used the program "Server Manager
430 for Domains" to add the primary NetBIOS name of the Samba server
431 as a member of the Domain. </P
433 >After this has been done, to join the Domain invoke <B
434 CLASS="COMMAND"
435 > smbpasswd</B
436 > with this parameter. smbpasswd will then
437 look up the Primary Domain Controller for the Domain (found in
438 the <TT
439 CLASS="FILENAME"
440 >smb.conf</TT
441 > file in the parameter
443 CLASS="PARAMETER"
445 >password server</I
446 ></TT
447 > and change the machine account
448 password used to create the secure Domain communication. This
449 password is then stored by smbpasswd in a TDB, writeable only by root,
450 called <TT
451 CLASS="FILENAME"
452 >secrets.tdb</TT
453 > </P
455 >Once this operation has been performed the <TT
456 CLASS="FILENAME"
457 > smb.conf</TT
458 > file may be updated to set the <B
459 CLASS="COMMAND"
460 > security = domain</B
461 > option and all future logins
462 to the Samba server will be authenticated to the Windows NT
463 PDC. </P
465 >Note that even though the authentication is being
466 done to the PDC all users accessing the Samba server must still
467 have a valid UNIX account on that machine. </P
469 >This option is only available when running smbpasswd as root.
471 ></DD
472 ><DT
473 >-U username</DT
474 ><DD
476 >This option may only be used in conjunction
477 with the <TT
478 CLASS="PARAMETER"
480 >-r</I
481 ></TT
482 > option. When changing
483 a password on a remote machine it allows the user to specify
484 the user name on that machine whose password will be changed. It
485 is present to allow users who have different user names on
486 different systems to change these passwords. </P
487 ></DD
488 ><DT
489 >-h</DT
490 ><DD
492 >This option prints the help string for <B
493 CLASS="COMMAND"
494 > smbpasswd</B
495 >, selecting the correct one for running as root
496 or as an ordinary user. </P
497 ></DD
498 ><DT
499 >-s</DT
500 ><DD
502 >This option causes smbpasswd to be silent (i.e.
503 not issue prompts) and to read its old and new passwords from
504 standard input, rather than from <TT
505 CLASS="FILENAME"
506 >/dev/tty</TT
508 (like the <B
509 CLASS="COMMAND"
510 >passwd(1)</B
511 > program does). This option
512 is to aid people writing scripts to drive smbpasswd</P
513 ></DD
514 ><DT
515 >username</DT
516 ><DD
518 >This specifies the username for all of the
520 >root only</EM
521 > options to operate on. Only root
522 can specify this parameter as only root has the permission needed
523 to modify attributes directly in the local smbpasswd file.
525 ></DD
526 ></DL
527 ></DIV
528 ></DIV
529 ><DIV
530 CLASS="REFSECT1"
532 NAME="AEN171"
533 ></A
534 ><H2
535 >NOTES</H2
537 >Since <B
538 CLASS="COMMAND"
539 >smbpasswd</B
540 > works in client-server
541 mode communicating with a local smbd for a non-root user then
542 the smbd daemon must be running for this to work. A common problem
543 is to add a restriction to the hosts that may access the <B
544 CLASS="COMMAND"
545 > smbd</B
546 > running on the local machine by specifying a
548 CLASS="PARAMETER"
550 >allow hosts</I
551 ></TT
552 > or <TT
553 CLASS="PARAMETER"
555 >deny hosts</I
556 ></TT
558 entry in the <TT
559 CLASS="FILENAME"
560 >smb.conf</TT
561 > file and neglecting to
562 allow "localhost" access to the smbd. </P
564 >In addition, the smbpasswd command is only useful if Samba
565 has been set up to use encrypted passwords. See the file
567 CLASS="FILENAME"
568 >ENCRYPTION.txt</TT
569 > in the docs directory for details
570 on how to do this. </P
571 ></DIV
572 ><DIV
573 CLASS="REFSECT1"
575 NAME="AEN181"
576 ></A
577 ><H2
578 >VERSION</H2
580 >This man page is correct for version 2.2 of
581 the Samba suite.</P
582 ></DIV
583 ><DIV
584 CLASS="REFSECT1"
586 NAME="AEN184"
587 ></A
588 ><H2
589 >SEE ALSO</H2
592 HREF="smbpasswd.5.html"
593 TARGET="_top"
594 ><TT
595 CLASS="FILENAME"
596 >smbpasswd(5)</TT
597 ></A
600 HREF="samba.7.html"
601 TARGET="_top"
602 >samba(7)</A
605 ></DIV
606 ><DIV
607 CLASS="REFSECT1"
609 NAME="AEN190"
610 ></A
611 ><H2
612 >AUTHOR</H2
614 >The original Samba software and related utilities
615 were created by Andrew Tridgell. Samba is now developed
616 by the Samba Team as an Open Source project similar
617 to the way the Linux kernel is developed.</P
619 >The original Samba man pages were written by Karl Auer.
620 The man page sources were converted to YODL format (another
621 excellent piece of Open Source software, available at
623 HREF="ftp://ftp.icce.rug.nl/pub/unix/"
624 TARGET="_top"
625 > ftp://ftp.icce.rug.nl/pub/unix/</A
626 >) and updated for the Samba 2.0
627 release by Jeremy Allison. The conversion to DocBook for
628 Samba 2.2 was done by Gerald Carter</P
629 ></DIV
630 ></BODY
631 ></HTML