First version of HTML docs generated from YODL source.
[ab/samba.git/.git] / docs / htmldocs / smbpasswd.8.html
1
2
3  
4
5
6 <html><head><title>smbpasswd</title>
7
8 <link rev="made" href="mailto:samba-bugs@samba.anu.edu.au">
9 </head>
10 <body>
11
12 <hr>
13
14 <h1>smbpasswd</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
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> also can 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 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 .B
73 must 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><a name="minusR"></a>
146 <li><strong><strong>-R name resolve order</strong></strong> This option allows the user of
147 smbclient to determine what name resolution services to use when
148 looking up the NetBIOS name of the host being connected to.
149 <p><br>The options are :<a href="smbpasswd.8.html#lmhosts">"lmhosts"</a>, <a href="smbpasswd.8.html#host">"host"</a>,
150 <a href="smbpasswd.8.html#wins">"wins"</a> and <a href="smbpasswd.8.html#bcast">"bcast"</a>. They cause names to be
151 resolved as follows :
152 <p><br><ul>
153 <p><br><a name="lmhosts"></a>
154 <li > <strong>lmhosts</strong> : Lookup an IP address in the Samba lmhosts file.
155 <p><br><a name="host"></a>
156 <li > <strong>host</strong> : Do a standard host name to IP address resolution,
157 using the system /etc/hosts, NIS, or DNS lookups. This method of name
158 resolution is operating system depended for instance on IRIX or
159 Solaris this may be controlled by the <em>/etc/nsswitch.conf</em> file).
160 <p><br><a name="wins"></a>
161 <li > <strong>wins</strong> : Query a name with the IP address listed in the <a href="smb.conf.5.html#winsserver"><strong>wins
162 server</strong></a> parameter in the smb.conf file. If 
163 no WINS server has been specified this method will be ignored.
164 <p><br><a name="bcast"></a>
165 <li > <strong>bcast</strong> : Do a broadcast on each of the known local interfaces
166 listed in the <a href="smb.conf.5.html#interfaces"><strong>interfaces</strong></a> parameter
167 in the smb.conf file. This is the least reliable of the name resolution
168 methods as it depends on the target host being on a locally connected
169 subnet.
170 <p><br></ul>
171 <p><br>If this parameter is not set then the name resolver order defined
172 in the <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file parameter 
173 <a href="smb.conf.5.html#nameresolveorder"><strong>name resolve order</strong></a>
174 will be used.
175 <p><br>The default order is lmhosts, host, wins, bcast and without this
176 parameter or any entry in the <a href="smb.conf.5.html"><strong>smb.conf</strong></a> 
177 file the name resolution methods will be attempted in this order.
178 <p><br><a name="minusm"></a>
179 <li><strong><strong>-m</strong></strong> This option tells <strong>smbpasswd</strong> that the account being
180 changed is a <em>MACHINE</em> account. Currently this is used when Samba is
181 being used as an NT Primary Domain Controller. PDC support is not a
182 supported feature in Samba2.0 but will become supported in a later
183 release. If you wish to know more about using Samba as an NT PDC then
184 please subscribe to the mailing list
185 <a href="mailto:samba-ntdom@samba.anu.edu.au"><em>samba-ntdom@samba.anu.edu.au</em></a>.
186 <p><br>This option is only available when running <strong>smbpasswd</strong> as root.
187 <p><br><a name="minusj"></a>
188 <li><strong><strong>-j DOMAIN</strong></strong> This option is used to add a Samba server into a
189 Windows NT Domain, as a Domain member capable of authenticating user
190 accounts to any Domain Controller in the same way as a Windows NT
191 Server. See the <a href="smb.conf.5.html#security"><strong>security=domain</strong></a>
192 option in the <a href="smb.conf.5.html"><strong>smb.conf (5)</strong></a> man page.
193 <p><br>In order to be used in this way, the Administrator for the Windows
194 NT Domain must have used the program <em>"Server Manager for Domains"</em>
195 to add the <a href="smb.conf.5.html#netbiosname">primary NetBIOS name</a> of 
196 the Samba server as a member of the Domain.
197 <p><br>After this has been done, to join the Domain invoke <strong>smbpasswd</strong> with
198 this parameter. <strong>smbpasswd</strong> will then look up the Primary Domain
199 Controller for the Domain (found in the
200 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file in the parameter
201 <a href="smb.conf.5.html#passwordserver"><strong>password server</strong></a> and change
202 the machine account password used to create the secure Domain
203 communication.  This password is then stored by <strong>smbpasswd</strong> in a
204 file, read only by root, called <code>&lt;Domain&gt;.&lt;Machine&gt;.mac</code> where
205 <code>&lt;Domain&gt;</code> is the name of the Domain we are joining and tt&lt;Machine&gt;
206 is the primary NetBIOS name of the machine we are running on.
207 <p><br>Once this operation has been performed the
208 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file may be updated to set the
209 <a href="smb.conf.5.html#security"><strong>security=domain</strong></a> option and all
210 future logins to the Samba server will be authenticated to the Windows
211 NT PDC.
212 <p><br>Note that even though the authentication is being done to the PDC all
213 users accessing the Samba server must still have a valid UNIX account
214 on that machine.
215 <p><br>This option is only available when running <strong>smbpasswd</strong> as root.
216 <p><br><a name="minusU"></a>
217 <li><strong><strong>-U username</strong></strong> This option may only be used in
218 conjunction with the <a href="smbpasswd.8.html#minusr"><strong>-r</strong></a>
219 option. When changing a password on a remote machine it allows the
220 user to specify the user name on that machine whose password will be
221 changed. It is present to allow users who have different user names on
222 different systems to change these passwords.
223 <p><br><a name="minush"></a>
224 <li><strong><strong>-h</strong></strong> This option prints the help string for <strong>smbpasswd</strong>, 
225 selecting the correct one for running as root or as an ordinary user.
226 <p><br><a name="minuss"></a>
227 <li><strong><strong>-s</strong></strong> This option causes <strong>smbpasswd</strong> to be silent (ie. not
228 issue prompts) and to read it's old and new passwords from standard 
229 input, rather than from <code>/dev/tty</code> (like the <strong>passwd (1)</strong> program
230 does). This option is to aid people writing scripts to drive <strong>smbpasswd</strong>
231 <p><br><a name="username"></a>
232 dir(<strong>username</strong>) This specifies the username for all of the <em>root
233 only</em> options to operate on. Only root can specify this parameter as
234 only root has the permission needed to modify attributes directly
235 in the local <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file.
236 <p><br><a name="NOTES"></a>
237 <h2>NOTES</h2>
238     
239 <p><br>As <strong>smbpasswd</strong> works in client-server mode communicating with a
240 local <a href="smbd.8.html"><strong>smbd</strong></a> for a non-root user then the <strong>smbd</strong>
241 daemon must be running for this to work. A common problem is to add a
242 restriction to the hosts that may access the <strong>smbd</strong> running on the
243 local machine by specifying a <a href="smb.conf.5.html#allowhosts"><strong>"allow
244 hosts"</strong></a> or <a href="smb.conf.5.html#denyhosts"><strong>"deny
245 hosts"</strong></a> entry in the
246 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file and neglecting to allow
247 <em>"localhost"</em> access to the <strong>smbd</strong>.
248 <p><br>In addition, the <strong>smbpasswd</strong> command is only useful if <strong>Samba</strong> has
249 been set up to use encrypted passwords. See the file <strong>ENCRYPTION.txt</strong>
250 in the docs directory for details on how to do this.
251 <p><br><a name="VERSION"></a>
252 <h2>VERSION</h2>
253     
254 <p><br>This man page is correct for version 2.0 of the Samba suite.
255 <p><br><a name="AUTHOR"></a>
256 <h2>AUTHOR</h2>
257     
258 <p><br>The original Samba software and related utilities were created by
259 Andrew Tridgell <a href="mailto:samba-bugs@samba.anu.edu.au"><em>samba-bugs@samba.anu.edu.au</em></a>. Samba is now developed
260 by the Samba Team as an Open Source project similar to the way the
261 Linux kernel is developed.
262 <p><br>The original Samba man pages were written by Karl Auer. The man page
263 sources were converted to YODL format (another excellent piece of Open
264 Source software) and updated for the Samba2.0 release by Jeremy
265 Allison, <a href="mailto:samba-bugs@samba.anu.edu.au"><em>samba-bugs@samba.anu.edu.au</em></a>.
266 <p><br>See <a href="samba.7.html"><strong>samba (7)</strong></a> to find out how to get a full
267 list of contributors and details on how to submit bug reports,
268 comments etc.
269 </body>
270 </html>