Added load_interfaces in smbpasswd to allow name resolution by broadcast and
[samba.git] / docs / htmldocs / smbpasswd.8.html
1
2
3  
4
5
6 <html><head><title>smbpasswd (8)</title>
7
8 <link rev="made" href="mailto:samba-bugs@samba.org">
9 </head>
10 <body>
11
12 <hr>
13
14 <h1>smbpasswd (8)</h1>
15 <h2>Samba</h2>
16 <h2>23 Oct 1998</h2>
17
18     
19
20     
21 <p><br><a name="NAME"></a>
22 <h2>NAME</h2>
23     smbpasswd - change a users SMB password
24 <p><br><a name="SYNOPSIS"></a>
25 <h2>SYNOPSIS</h2>
26      
27 <p><br><strong>smbpasswd</strong> [<a href="smbpasswd.8.html#minusa">-a</a>] [<a href="smbpasswd.8.html#minusd">-d</a>] [<a href="smbpasswd.8.html#minuse">-e</a>] [<a href="smbpasswd.8.html#minusD">-D debug level</a>] [<a href="smbpasswd.8.html#minusn">-n</a>] [<a href="smbpasswd.8.html#minusr">-r remote_machine</a>] [<a href="smbpasswd.8.html#minusR">-R name resolve order</a>] [<a href="smbpasswd.8.html#minusm">-m</a>] [<a href="smbpasswd.8.html#minusj">-j DOMAIN</a>] [<a href="smbpasswd.8.html#minusU">-U username</a>] [<a href="smbpasswd.8.html#minush">-h</a>] [<a href="smbpasswd.8.html#minuss">-s</a>] <a href="smbpasswd.8.html#username">username</a>
28 <p><br><a name="DESCRIPTION"></a>
29 <h2>DESCRIPTION</h2>
30     
31 <p><br>This program is part of the <strong>Samba</strong> suite.
32 <p><br>The <strong>smbpasswd</strong> program has several different functions, depending
33 on whether it is run by the <em>root</em> user or not. When run as a normal
34 user it allows the user to change the password used for their SMB
35 sessions on any machines that store SMB passwords.
36 <p><br>By default (when run with no arguments) it will attempt to change the
37 current users SMB password on the local machine. This is similar to
38 the way the <strong>passwd (1)</strong> program works. <strong>smbpasswd</strong> differs from how
39 the <strong>passwd</strong> program works however in that it is not <em>setuid root</em>
40 but works in a client-server mode and communicates with a locally
41 running <a href="smbd.8.html"><strong>smbd</strong></a>. As a consequence in order for this
42 to succeed the <a href="smbd.8.html"><strong>smbd</strong></a> daemon must be running on
43 the local machine. On a UNIX machine the encrypted SMB passwords are
44 usually stored in the <a href="smbpasswd.5.html"><strong>smbpasswd (5)</strong></a> file.
45 <p><br>When run by an ordinary user with no options. <strong>smbpasswd</strong> will
46 prompt them for their old smb password and then ask them for their new
47 password twice, to ensure that the new password was typed
48 correctly. No passwords will be echoed on the screen whilst being
49 typed. If you have a blank smb password (specified by the string "NO
50 PASSWORD" in the <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file) then just
51 press the &lt;Enter&gt; key when asked for your old password.
52 <p><br><strong>smbpasswd</strong> can also be used by a normal user to change their SMB
53 password on remote machines, such as Windows NT Primary Domain
54 Controllers. See the <a href="smbpasswd.8.html#minusr">(<strong>-r</strong>)</a> and
55 <a href="smbpasswd.8.html#minusU"><strong>-U</strong></a> options below.
56 <p><br>When run by root, <strong>smbpasswd</strong> allows new users to be added and
57 deleted in the <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file, as well as
58 allows changes to the attributes of the user in this file to be made. When
59 run by root, <strong>smbpasswd</strong> accesses the local
60 <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file directly, thus enabling
61 changes to be made even if <a href="smbd.8.html"><strong>smbd</strong></a> is not running.
62 <p><br><a name="OPTIONS"></a>
63 <h2>OPTIONS</h2>
64     
65 <p><br><ul>
66 <p><br><a name="minusa"></a>
67 <li><strong><strong>-a</strong></strong> This option specifies that the username following should
68 be added to the local <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file, with
69 the new password typed (type &lt;Enter&gt; for the old password). This
70 option is ignored if the username following already exists in the
71 <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file and it is treated like a
72 regular change password command. Note that the user to be added
73 <strong>must</strong> already exist in the system password file (usually /etc/passwd)
74 else the request to add the user will fail.
75 <p><br>This option is only available when running <strong>smbpasswd</strong> as
76 root.
77 <p><br><a name="minusd"></a>
78 <li><strong><strong>-d</strong></strong> This option specifies that the username following should be
79 <em>disabled</em> in the local <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file.
80 This is done by writing a <em>'D'</em> flag into the account control space
81 in the <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. Once this is done
82 all attempts to authenticate via SMB using this username will fail.
83 <p><br>If the <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file is in the 'old'
84 format (pre-Samba 2.0 format) there is no space in the users password
85 entry to write this information and so the user is disabled by writing
86 'X' characters into the password space in the
87 <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. See <a href="smbpasswd.5.html"><strong>smbpasswd
88 (5)</strong></a> for details on the 'old' and new password file
89 formats.
90 <p><br>This option is only available when running <strong>smbpasswd</strong> as root.
91 <p><br><a name="minuse"></a>
92 <li><strong><strong>-e</strong></strong> This option specifies that the username following should be
93 <em>enabled</em> in the local <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file,
94 if the account was previously disabled. If the account was not
95 disabled this option has no effect. Once the account is enabled
96 then the user will be able to authenticate via SMB once again.
97 <p><br>If the smbpasswd file is in the 'old' format then <strong>smbpasswd</strong> will
98 prompt for a new password for this user, otherwise the account will be
99 enabled by removing the <em>'D'</em> flag from account control space in the
100 <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. See <a href="smbpasswd.5.html"><strong>smbpasswd
101 (5)</strong></a> for details on the 'old' and new password file
102 formats.
103 <p><br>This option is only available when running <strong>smbpasswd</strong> as root.
104 <p><br><a name="minusD"></a>
105 <li><strong><strong>-D debuglevel</strong></strong> debuglevel is an integer from 0
106 to 10.  The default value if this parameter is not specified is zero.
107 <p><br>The higher this value, the more detail will be logged to the log files
108 about the activities of smbpasswd. At level 0, only critical errors
109 and serious warnings will be logged.
110 <p><br>Levels above 1 will generate considerable amounts of log data, and
111 should only be used when investigating a problem. Levels above 3 are
112 designed for use only by developers and generate HUGE amounts of log
113 data, most of which is extremely cryptic.
114 <p><br><a name="minusn"></a>
115 <li><strong><strong>-n</strong></strong> This option specifies that the username following should
116 have their password set to null (i.e. a blank password) in the local
117 <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. This is done by writing the
118 string "NO PASSWORD" as the first part of the first password stored in
119 the <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file.
120 <p><br>Note that to allow users to logon to a Samba server once the password
121 has been set to "NO PASSWORD" in the
122 <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file the administrator must set
123 the following parameter in the [global] section of the
124 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file :
125 <p><br><a href="smb.conf.5.html#nullpasswords">null passwords = true</a>
126 <p><br>This option is only available when running <strong>smbpasswd</strong> as root.
127 <p><br><a name="minusr"></a> 
128 <li><strong><strong>-r remote machine name</strong></strong> This option allows a
129 user to specify what machine they wish to change their password
130 on. Without this parameter <strong>smbpasswd</strong> defaults to the local
131 host. The <em>"remote machine name"</em> is the NetBIOS name of the
132 SMB/CIFS server to contact to attempt the password change. This name
133 is resolved into an IP address using the standard name resolution
134 mechanism in all programs of the <a href="samba.7.html"><strong>Samba</strong></a>
135 suite. See the <a href="smbpasswd.8.html#minusR"><strong>-R name resolve order</strong></a> parameter for details on changing this resolving
136 mechanism.
137 <p><br>The username whose password is changed is that of the current UNIX
138 logged on user. See the <a href="smbpasswd.8.html#minusU"><strong>-U username</strong></a>
139 parameter for details on changing the password for a different
140 username.
141 <p><br>Note that if changing a Windows NT Domain password the remote machine
142 specified must be the Primary Domain Controller for the domain (Backup
143 Domain Controllers only have a read-only copy of the user account
144 database and will not allow the password change).
145 <p><br><em>Note</em> that Windows 95/98 do not have a real password database
146 so it is not possible to change passwords specifying a Win95/98 
147 machine as remote machine target.
148 <p><br><a name="minusR"></a>
149 <li><strong><strong>-R name resolve order</strong></strong> This option allows the user of
150 smbclient to determine what name resolution services to use when
151 looking up the NetBIOS name of the host being connected to.
152 <p><br>The options are :<a href="smbpasswd.8.html#lmhosts">"lmhosts"</a>, <a href="smbpasswd.8.html#host">"host"</a>,
153 <a href="smbpasswd.8.html#wins">"wins"</a> and <a href="smbpasswd.8.html#bcast">"bcast"</a>. They cause names to be
154 resolved as follows :
155 <p><br><ul>
156 <p><br><a name="lmhosts"></a>
157 <li > <strong>lmhosts</strong> : Lookup an IP address in the Samba lmhosts file.
158 <p><br><a name="host"></a>
159 <li > <strong>host</strong> : Do a standard host name to IP address resolution,
160 using the system /etc/hosts, NIS, or DNS lookups. This method of name
161 resolution is operating system dependent. For instance on IRIX or
162 Solaris, this may be controlled by the <em>/etc/nsswitch.conf</em> file).
163 <p><br><a name="wins"></a>
164 <li > <strong>wins</strong> : Query a name with the IP address listed in the 
165 <a href="smb.conf.5.html#winsserver"><strong>wins server</strong></a> parameter in the 
166 <a href="smb.conf.5.html"><strong>smb.conf file</strong></a>. If 
167 no WINS server has been specified this method will be ignored.
168 <p><br><a name="bcast"></a>
169 <li > <strong>bcast</strong> : Do a broadcast on each of the known local interfaces
170 listed in the <a href="smb.conf.5.html#interfaces"><strong>interfaces</strong></a> parameter
171 in the smb.conf file. This is the least reliable of the name resolution
172 methods as it depends on the target host being on a locally connected
173 subnet.
174 <p><br></ul>
175 <p><br>If this parameter is not set then the name resolve order defined
176 in the <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file parameter 
177 <a href="smb.conf.5.html#nameresolveorder"><strong>name resolve order</strong></a>
178 will be used.
179 <p><br>The default order is lmhosts, host, wins, bcast and without this
180 parameter or any entry in the <a href="smb.conf.5.html"><strong>smb.conf</strong></a> 
181 file the name resolution methods will be attempted in this order.
182 <p><br><a name="minusm"></a>
183 <li><strong><strong>-m</strong></strong> This option tells <strong>smbpasswd</strong> that the account being
184 changed is a <em>MACHINE</em> account. Currently this is used when Samba is
185 being used as an NT Primary Domain Controller. PDC support is not a
186 supported feature in Samba2.0 but will become supported in a later
187 release. If you wish to know more about using Samba as an NT PDC then
188 please subscribe to the mailing list
189 <a href="mailto:samba-ntdom@samba.org"><em>samba-ntdom@samba.org</em></a>.
190 <p><br>This option is only available when running <strong>smbpasswd</strong> as root.
191 <p><br><a name="minusj"></a>
192 <li><strong><strong>-j DOMAIN</strong></strong> This option is used to add a Samba server into a
193 Windows NT Domain, as a Domain member capable of authenticating user
194 accounts to any Domain Controller in the same way as a Windows NT
195 Server. See the <a href="smb.conf.5.html#security"><strong>security=domain</strong></a>
196 option in the <a href="smb.conf.5.html"><strong>smb.conf (5)</strong></a> man page.
197 <p><br>In order to be used in this way, the Administrator for the Windows
198 NT Domain must have used the program <em>"Server Manager for Domains"</em>
199 to add the <a href="smb.conf.5.html#netbiosname">primary NetBIOS name</a> of 
200 the Samba server as a member of the Domain.
201 <p><br>After this has been done, to join the Domain invoke <strong>smbpasswd</strong> with
202 this parameter. <strong>smbpasswd</strong> will then look up the Primary Domain
203 Controller for the Domain (found in the
204 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file in the parameter
205 <a href="smb.conf.5.html#passwordserver"><strong>password server</strong></a> and change
206 the machine account password used to create the secure Domain
207 communication.  This password is then stored by <strong>smbpasswd</strong> in a
208 file, read only by root, called <code>&lt;Domain&gt;.&lt;Machine&gt;.mac</code> where
209 <code>&lt;Domain&gt;</code> is the name of the Domain we are joining and <code>&lt;Machine&gt;</code>
210 is the primary NetBIOS name of the machine we are running on.
211 <p><br>Once this operation has been performed the
212 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file may be updated to set the
213 <a href="smb.conf.5.html#security"><strong>security=domain</strong></a> option and all
214 future logins to the Samba server will be authenticated to the Windows
215 NT PDC.
216 <p><br>Note that even though the authentication is being done to the PDC all
217 users accessing the Samba server must still have a valid UNIX account
218 on that machine.
219 <p><br>This option is only available when running <strong>smbpasswd</strong> as root.
220 <p><br><a name="minusU"></a>
221 <li><strong><strong>-U username</strong></strong> This option may only be used in
222 conjunction with the <a href="smbpasswd.8.html#minusr"><strong>-r</strong></a>
223 option. When changing a password on a remote machine it allows the
224 user to specify the user name on that machine whose password will be
225 changed. It is present to allow users who have different user names on
226 different systems to change these passwords.
227 <p><br><a name="minush"></a>
228 <li><strong><strong>-h</strong></strong> This option prints the help string for <strong>smbpasswd</strong>, 
229 selecting the correct one for running as root or as an ordinary user.
230 <p><br><a name="minuss"></a>
231 <li><strong><strong>-s</strong></strong> This option causes <strong>smbpasswd</strong> to be silent (i.e. not
232 issue prompts) and to read it's old and new passwords from standard 
233 input, rather than from <code>/dev/tty</code> (like the <strong>passwd (1)</strong> program
234 does). This option is to aid people writing scripts to drive <strong>smbpasswd</strong>
235 <p><br><a name="username"></a>
236 <li><strong><strong>username</strong></strong> This specifies the username for all of the <em>root
237 only</em> options to operate on. Only root can specify this parameter as
238 only root has the permission needed to modify attributes directly
239 in the local <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file.
240 <p><br><a name="NOTES"></a>
241 <h2>NOTES</h2>
242     
243 <p><br>Since <strong>smbpasswd</strong> works in client-server mode communicating with a
244 local <a href="smbd.8.html"><strong>smbd</strong></a> for a non-root user then the <strong>smbd</strong>
245 daemon must be running for this to work. A common problem is to add a
246 restriction to the hosts that may access the <strong>smbd</strong> running on the
247 local machine by specifying a <a href="smb.conf.5.html#allowhosts"><strong>"allow
248 hosts"</strong></a> or <a href="smb.conf.5.html#denyhosts"><strong>"deny
249 hosts"</strong></a> entry in the
250 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file and neglecting to allow
251 <em>"localhost"</em> access to the <strong>smbd</strong>.
252 <p><br>In addition, the <strong>smbpasswd</strong> command is only useful if <strong>Samba</strong> has
253 been set up to use encrypted passwords. See the file <strong>ENCRYPTION.txt</strong>
254 in the docs directory for details on how to do this.
255 <p><br><a name="VERSION"></a>
256 <h2>VERSION</h2>
257     
258 <p><br>This man page is correct for version 2.0 of the Samba suite.
259 <p><br><a name="AUTHOR"></a>
260 <h2>AUTHOR</h2>
261     
262 <p><br>The original Samba software and related utilities were created by
263 Andrew Tridgell <a href="mailto:samba-bugs@samba.org"><em>samba-bugs@samba.org</em></a>. Samba is now developed
264 by the Samba Team as an Open Source project similar to the way the
265 Linux kernel is developed.
266 <p><br>The original Samba man pages were written by Karl Auer. The man page
267 sources were converted to YODL format (another excellent piece of Open
268 Source software, available at
269 <a href="ftp://ftp.icce.rug.nl/pub/unix/"><strong>ftp://ftp.icce.rug.nl/pub/unix/</strong></a>)
270 and updated for the Samba2.0 release by Jeremy Allison.
271 <a href="mailto:samba-bugs@samba.org"><em>samba-bugs@samba.org</em></a>.
272 <p><br>See <a href="samba.7.html"><strong>samba (7)</strong></a> to find out how to get a full
273 list of contributors and details on how to submit bug reports,
274 comments etc.
275 </body>
276 </html>