1SMBPASSWD(8)              System Administration tools             SMBPASSWD(8)
2
3
4

NAME

6       smbpasswd - change a user´s SMB password
7

SYNOPSIS

9       smbpasswd [-a] [-c <config file>] [-x] [-d] [-e] [-D debuglevel] [-n]
10        [-r <remote machine>] [-R <name resolve order>] [-m]
11        [-U username[%password]] [-h] [-s] [-w pass] [-W] [-i] [-L] [username]
12

DESCRIPTION

14       This tool is part of the samba(7) suite.
15
16       The smbpasswd program has several different functions, depending on
17       whether it is run by the root user or not. When run as a normal user it
18       allows the user to change the password used for their SMB sessions on
19       any machines that store SMB passwords.
20
21       By default (when run with no arguments) it will attempt to change the
22       current user´s SMB password on the local machine. This is similar to
23       the way the passwd(1) program works.  smbpasswd differs from how the
24       passwd program works however in that it is not setuid root but works in
25       a client-server mode and communicates with a locally running smbd(8).
26       As a consequence in order for this to succeed the smbd daemon must be
27       running on the local machine. On a UNIX machine the encrypted SMB
28       passwords are usually stored in the smbpasswd(5) file.
29
30       When run by an ordinary user with no options, smbpasswd will prompt
31       them for their old SMB password and then ask them for their new
32       password twice, to ensure that the new password was typed correctly. No
33       passwords will be echoed on the screen whilst being typed. If you have
34       a blank SMB password (specified by the string "NO PASSWORD" in the
35       smbpasswd file) then just press the <Enter> key when asked for your old
36       password.
37
38       smbpasswd can also be used by a normal user to change their SMB
39       password on remote machines, such as Windows NT Primary Domain
40       Controllers. See the (-r) and -U options below.
41
42       When run by root, smbpasswd allows new users to be added and deleted in
43       the smbpasswd file, as well as allows changes to the attributes of the
44       user in this file to be made. When run by root, smbpasswd accesses the
45       local smbpasswd file directly, thus enabling changes to be made even if
46       smbd is not running.
47

OPTIONS

49       -a
50           This option specifies that the username following should be added
51           to the local smbpasswd file, with the new password typed (type
52           <Enter> for the old password). This option is ignored if the
53           username following already exists in the smbpasswd file and it is
54           treated like a regular change password command. Note that the
55           default passdb backends require the user to already exist in the
56           system password file (usually /etc/passwd), else the request to add
57           the user will fail.
58
59           This option is only available when running smbpasswd as root.
60
61       -c
62           This option can be used to specify the path and file name of the
63           smb.conf configuration file when it is important to use other than
64           the default file and / or location.
65
66       -x
67           This option specifies that the username following should be deleted
68           from the local smbpasswd file.
69
70           This option is only available when running smbpasswd as root.
71
72       -d
73           This option specifies that the username following should be
74           disabled in the local smbpasswd file. This is done by writing a ´D´
75           flag into the account control space in the smbpasswd file. Once
76           this is done all attempts to authenticate via SMB using this
77           username will fail.
78
79           If the smbpasswd file is in the ´old´ format (pre-Samba 2.0 format)
80           there is no space in the user´s password entry to write this
81           information and the command will FAIL. See smbpasswd(5) for details
82           on the ´old´ and new password file formats.
83
84           This option is only available when running smbpasswd as root.
85
86       -e
87           This option specifies that the username following should be enabled
88           in the local smbpasswd file, if the account was previously
89           disabled. If the account was not disabled this option has no
90           effect. Once the account is enabled then the user will be able to
91           authenticate via SMB once again.
92
93           If the smbpasswd file is in the ´old´ format, then smbpasswd will
94           FAIL to enable the account. See smbpasswd(5) for details on the
95           ´old´ and new password file formats.
96
97           This option is only available when running smbpasswd as root.
98
99       -D debuglevel
100           debuglevel is an integer from 0 to 10. The default value if this
101           parameter is not specified is zero.
102
103           The higher this value, the more detail will be logged to the log
104           files about the activities of smbpasswd. At level 0, only critical
105           errors and serious warnings will be logged.
106
107           Levels above 1 will generate considerable amounts of log data, and
108           should only be used when investigating a problem. Levels above 3
109           are designed for use only by developers and generate HUGE amounts
110           of log data, most of which is extremely cryptic.
111
112       -n
113           This option specifies that the username following should have their
114           password set to null (i.e. a blank password) in the local smbpasswd
115           file. This is done by writing the string "NO PASSWORD" as the first
116           part of the first password stored in the smbpasswd file.
117
118           Note that to allow users to logon to a Samba server once the
119           password has been set to "NO PASSWORD" in the smbpasswd file the
120           administrator must set the following parameter in the [global]
121           section of the smb.conf file :
122
123           null passwords = yes
124
125           This option is only available when running smbpasswd as root.
126
127       -r remote machine name
128           This option allows a user to specify what machine they wish to
129           change their password on. Without this parameter smbpasswd defaults
130           to the local host. The remote machine name is the NetBIOS name of
131           the SMB/CIFS server to contact to attempt the password change. This
132           name is resolved into an IP address using the standard name
133           resolution mechanism in all programs of the Samba suite. See the -R
134           name resolve order parameter for details on changing this resolving
135           mechanism.
136
137           The username whose password is changed is that of the current UNIX
138           logged on user. See the -U username parameter for details on
139           changing the password for a different username.
140
141           Note that if changing a Windows NT Domain password the remote
142           machine specified must be the Primary Domain Controller for the
143           domain (Backup Domain Controllers only have a read-only copy of the
144           user account database and will not allow the password change).
145
146           Note that Windows 95/98 do not have a real password database so it
147           is not possible to change passwords specifying a Win95/98 machine
148           as remote machine target.
149
150       -R name resolve order
151           This option allows the user of smbpasswd to determine what name
152           resolution services to use when looking up the NetBIOS name of the
153           host being connected to.
154
155           The options are :"lmhosts", "host", "wins" and "bcast". They cause
156           names to be resolved as follows:
157
158           ·   lmhosts: Lookup an IP address in the Samba lmhosts file. If the
159               line in lmhosts has no name type attached to the NetBIOS name
160               (see the lmhosts(5) for details) then any name type matches for
161               lookup.
162
163           ·   host: Do a standard host name to IP address resolution, using
164               the system /etc/hosts, NIS, or DNS lookups. This method of name
165               resolution is operating system depended for instance on IRIX or
166               Solaris this may be controlled by the /etc/nsswitch.conf file).
167               Note that this method is only used if the NetBIOS name type
168               being queried is the 0x20 (server) name type, otherwise it is
169               ignored.
170
171           ·   wins: Query a name with the IP address listed in the wins
172               server parameter. If no WINS server has been specified this
173               method will be ignored.
174
175           ·   bcast: Do a broadcast on each of the known local interfaces
176               listed in the interfaces parameter. This is the least reliable
177               of the name resolution methods as it depends on the target host
178               being on a locally connected subnet.
179
180       The default order is lmhosts, host, wins, bcast and without this
181       parameter or any entry in the smb.conf(5) file the name resolution
182       methods will be attempted in this order.
183
184       -m
185           This option tells smbpasswd that the account being changed is a
186           MACHINE account. Currently this is used when Samba is being used as
187           an NT Primary Domain Controller.
188
189           This option is only available when running smbpasswd as root.
190
191       -U username
192           This option may only be used in conjunction with the -r option.
193           When changing a password on a remote machine it allows the user to
194           specify the user name on that machine whose password will be
195           changed. It is present to allow users who have different user names
196           on different systems to change these passwords.
197
198       -h
199           This option prints the help string for smbpasswd, selecting the
200           correct one for running as root or as an ordinary user.
201
202       -s
203           This option causes smbpasswd to be silent (i.e. not issue prompts)
204           and to read its old and new passwords from standard input, rather
205           than from /dev/tty (like the passwd(1) program does). This option
206           is to aid people writing scripts to drive smbpasswd
207
208       -w password
209           This parameter is only available if Samba has been compiled with
210           LDAP support. The -w switch is used to specify the password to be
211           used with the ldap admin dn. Note that the password is stored in
212           the secrets.tdb (or secrets.ntdb) and is keyed off of the admin´s
213           DN. This means that if the value of ldap admin dn ever changes, the
214           password will need to be manually updated as well.
215
216       -W
217           NOTE: This option is same as "-w" except that the password should
218           be entered using stdin.
219
220           This parameter is only available if Samba has been compiled with
221           LDAP support. The -W switch is used to specify the password to be
222           used with the ldap admin dn. Note that the password is stored in
223           the secrets.tdb (or secrets.ntdb) and is keyed off of the admin´s
224           DN. This means that if the value of ldap admin dn ever changes, the
225           password will need to be manually updated as well.
226
227       -i
228           This option tells smbpasswd that the account being changed is an
229           interdomain trust account. Currently this is used when Samba is
230           being used as an NT Primary Domain Controller. The account contains
231           the info about another trusted domain.
232
233           This option is only available when running smbpasswd as root.
234
235       -L
236           Run in local mode.
237
238       username
239           This specifies the username for all of the root only options to
240           operate on. Only root can specify this parameter as only root has
241           the permission needed to modify attributes directly in the local
242           smbpasswd file.
243

NOTES

245       Since smbpasswd works in client-server mode communicating with a local
246       smbd for a non-root user then the smbd daemon must be running for this
247       to work. A common problem is to add a restriction to the hosts that may
248       access the smbd running on the local machine by specifying either allow
249       hosts or deny hosts entry in the smb.conf(5) file and neglecting to
250       allow "localhost" access to the smbd.
251
252       In addition, the smbpasswd command is only useful if Samba has been set
253       up to use encrypted passwords.
254

VERSION

256       This man page is correct for version 3 of the Samba suite.
257

SEE ALSO

259       smbpasswd(5), Samba(7).
260

AUTHOR

262       The original Samba software and related utilities were created by
263       Andrew Tridgell. Samba is now developed by the Samba Team as an Open
264       Source project similar to the way the Linux kernel is developed.
265
266       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 ftp://ftp.icce.rug.nl/pub/unix/) and
269       updated for the Samba 2.0 release by Jeremy Allison. The conversion to
270       DocBook for Samba 2.2 was done by Gerald Carter. The conversion to
271       DocBook XML 4.2 for Samba 3.0 was done by Alexander Bokovoy.
272
273
274
275Samba 4.2                         06/19/2018                      SMBPASSWD(8)
Impressum