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