1 mailto(samba-bugs@samba.anu.edu.au)
3 manpage(smbpasswd)(5)(23 Oct 1998)(Samba)(SAMBA)
6 manpagename(smbpasswd)(The Samba encrypted password file)
11 smbpasswd is the bf(Samba) encrypted password file.
16 This file is part of the bf(Samba) suite.
18 smbpasswd is the bf(Samba) encrypted password file. It contains
19 the username, unix user id and the SMB hashed passwords of the
20 user, as well as account flag information and the time the password
21 was last changed. This file format has been evolving with Samba
22 and has had several different formats in the past.
25 manpagesection(FILE FORMAT)
27 The format of the smbpasswd file used by Samba 2.0 is very similar to
28 the familiar unix bf(passwd (5)) file. It is an ASCII file containing
29 one line for each user. Each field within each line is separated from
30 the next by a colon. Any entry beginning with # is ignored. The
31 smbpasswd file contains the following information for each user:
36 dit(bf(name)) nl() nl()
38 This is the user name. It must be a name that already exists
39 in the standard UNIX passwd file.
42 dit(bf(uid)) nl() nl()
44 This is the UNIX uid. It must match the uid field for the same
45 user entry in the standard UNIX passwd file.
47 label(LanmanPasswordHash)
48 dit(bf(Lanman Password Hash)) nl() nl()
50 This is the em(LANMAN) hash of the users password, encoded as 32 hex
51 digits. The em(LANMAN) hash is created by DES encrypting a well known
52 string with the users password as the DES key. This is the same
53 password used by Windows 95/98 machines. Note that this password hash
54 is regarded as weak as it is vulnerable to dictionary attacks and if
55 two users choose the same password this entry will be identical (ie.
56 the password is not em("salted") as the UNIX password is). If the
57 user has a null password this field will contain the characters
58 tt("NO PASSWORD") as the start of the hex string. If the hex string
59 is equal to 32 tt('X') characters then the users account is marked as
60 em(disabled) and the user will not be able to log onto the Samba
63 em(WARNING !!). Note that, due to the challenge-response nature of the
64 SMB/CIFS authentication protocol, anyone with a knowledge of this
65 password hash will be able to impersonate the user of the network.
66 For this reason these hashes are known as em("plain text equivalent")
67 and must em(NOT) be made available to anyone but the root user. To
68 protect these passwords the bf(smbpasswd) file is placed in a
69 directory with read and traverse access only to the root user and the
70 bf(smbpasswd) file itself must be set to be read/write only by root,
74 dit(bf(NT Password Hash)) nl() nl()
76 This is the em(Windows NT) hash of the users password, encoded as 32
77 hex digits. The em(Windows NT) hash is created by taking the users
78 password as represented in 16-bit, little-endian UNICODE and then
79 applying the em(MD4) (internet rfc1321) hashing algorithm to it.
81 This password hash is considered more secure than the link(bf(Lanman
82 Password Hash))(LanmanPasswordHash) as it preserves the case of the
83 password and uses a much higher quality hashing algorithm. However, it
84 is still the case that if two users choose the same password this
85 entry will be identical (ie. the password is not em("salted") as the
88 em(WARNING !!). Note that, due to the challenge-response nature of the
89 SMB/CIFS authentication protocol, anyone with a knowledge of this
90 password hash will be able to impersonate the user of the network.
91 For this reason these hashes are known as em("plain text equivalent")
92 and must em(NOT) be made available to anyone but the root user. To
93 protect these passwords the bf(smbpasswd) file is placed in a
94 directory with read and traverse access only to the root user and the
95 bf(smbpasswd) file itself must be set to be read/write only by root,
99 dit(bf(Account Flags)) nl() nl()
101 This section contains flags that describe the attributes of the users
102 account. In the bf(Samba2.0) release this field is bracketed by tt('[')
103 and tt(']') characters and is always 13 characters in length (including
104 the tt('[') and tt(']') characters). The contents of this field may be
105 any of the characters.
110 it() bf('U') This means this is a em("User") account, ie. an ordinary
111 user. Only bf(User) and link(bf(Worskstation Trust))(capW) accounts are
112 currently supported in the bf(smbpasswd) file.
115 it() bf('N') This means the account has em(no) password (the passwords
116 in the fields link(bf(Lanman Password Hash))(LanmanPasswordHash) and
117 link(bf(NT Password Hash))(NTPasswordHash) are ignored). Note that this
118 will only allow users to log on with no password if the
119 url(bf(null passwords))(smb.conf.5.html#nullpasswords) parameter is set
120 in the url(bf(smb.conf (5)))(smb.conf.5.html) config file.
123 it() bf('D') This means the account is diabled and no SMB/CIFS logins
124 will be allowed for this user.
127 it() bf('W') This means this account is a em("Workstation Trust") account.
128 This kind of account is used in the Samba PDC code stream to allow Windows
129 NT Workstations and Servers to join a Domain hosted by a Samba PDC.
133 Other flags may be added as the code is extended in future. The rest of
134 this field space is filled in with spaces.
136 label(LastChangeTime)
137 dit(bf(Last Change Time)) nl() nl()
139 This field consists of the time the account was last modified. It consists of
140 the characters tt(LCT-) (standing for em("Last Change Time")) followed by a numeric
141 encoding of the UNIX time in seconds since the epoch (1970) that the last change
144 dit(bf(Following fields)) nl() nl()
146 All other colon separated fields are ignored at this time.
151 manpagesection(NOTES)
153 In previous versions of Samba (notably the 1.9.18 series) this file
154 did not contain the link(bf(Account Flags))(AccountFlags) or
155 link(bf(Last Change Time))(LastChangeTime) fields. The Samba 2.0
156 code will read and write these older password files but will not be able to
157 modify the old entries to add the new fields. New entries added with
158 url(bf(smbpasswd (8)))(smbpasswd.8.html) will contain the new fields
159 in the added accounts however. Thus an older bf(smbpasswd) file used
160 with Samba 2.0 may end up with some accounts containing the new fields
163 In order to convert from an old-style bf(smbpasswd) file to a new
164 style, run the script bf(convert_smbpasswd), installed in the
165 Samba tt(bin/) directory (the same place that the url(bf(smbd))(smbd.8.html)
166 and url(bf(nmbd))(nmbd.8.html) binaries are installed) as follows:
170 cat old_smbpasswd_file | convert_smbpasswd > new_smbpasswd_file
174 The bf(convert_smbpasswd) script reads from stdin and writes to stdout
175 so as not to overwrite any files by accident.
177 Once this script has been run, check the contents of the new smbpasswd
178 file to ensure that it has not been damaged by the conversion script
179 (which uses bf(awk)), and then replace the tt(<old smbpasswd file>)
180 with the tt(<new smbpasswd file>).
183 manpagesection(VERSION)
185 This man page is correct for version 2.0 of the Samba suite.
190 url(bf(smbpasswd (8)))(smbpasswd.8.html), url(bf(samba
191 (7)))(samba.7.html), and the Internet RFC1321 for details on the MD4
197 The original Samba software and related utilities were created by
198 Andrew Tridgell (samba-bugs@samba.anu.edu.au). Samba is now developed
199 by the Samba Team as an Open Source project similar to the way the
200 Linux kernel is developed.
202 The original Samba man pages were written by Karl Auer. The man page
203 sources were converted to YODL format (another excellent piece of Open
204 Source software) and updated for the Samba2.0 release by Jeremy
205 Allison, email(samba-bugs@samba.anu.edu.au).
207 See url(bf(samba (7)))(samba.7.html) to find out how to get a full
208 list of contributors and details on how to submit bug reports,