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