1 mailto(samba-bugs@samba.org)
3 manpage(smbpasswd htmlcommand((5)))(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. If this does not
46 match then Samba will refuse to recognize this bf(smbpasswd) file entry
47 as being valid for a user.
49 label(LanmanPasswordHash)
50 dit(bf(Lanman Password Hash)) nl() nl()
52 This is the em(LANMAN) hash of the users password, encoded as 32 hex
53 digits. The em(LANMAN) hash is created by DES encrypting a well known
54 string with the users password as the DES key. This is the same
55 password used by Windows 95/98 machines. Note that this password hash
56 is regarded as weak as it is vulnerable to dictionary attacks and if
57 two users choose the same password this entry will be identical (i.e.
58 the password is not em("salted") as the UNIX password is). If the
59 user has a null password this field will contain the characters
60 tt("NO PASSWORD") as the start of the hex string. If the hex string
61 is equal to 32 tt('X') characters then the users account is marked as
62 em(disabled) and the user will not be able to log onto the Samba
65 em(WARNING !!). Note that, due to the challenge-response nature of the
66 SMB/CIFS authentication protocol, anyone with a knowledge of this
67 password hash will be able to impersonate the user on the network.
68 For this reason these hashes are known as em("plain text equivalent")
69 and must em(NOT) be made available to anyone but the root user. To
70 protect these passwords the bf(smbpasswd) file is placed in a
71 directory with read and traverse access only to the root user and the
72 bf(smbpasswd) file itself must be set to be read/write only by root,
76 dit(bf(NT Password Hash)) nl() nl()
78 This is the em(Windows NT) hash of the users password, encoded as 32
79 hex digits. The em(Windows NT) hash is created by taking the users
80 password as represented in 16-bit, little-endian UNICODE and then
81 applying the em(MD4) (internet rfc1321) hashing algorithm to it.
83 This password hash is considered more secure than the link(bf(Lanman
84 Password Hash))(LanmanPasswordHash) as it preserves the case of the
85 password and uses a much higher quality hashing algorithm. However, it
86 is still the case that if two users choose the same password this
87 entry will be identical (i.e. the password is not em("salted") as the
90 em(WARNING !!). Note that, due to the challenge-response nature of the
91 SMB/CIFS authentication protocol, anyone with a knowledge of this
92 password hash will be able to impersonate the user on the network.
93 For this reason these hashes are known as em("plain text equivalent")
94 and must em(NOT) be made available to anyone but the root user. To
95 protect these passwords the bf(smbpasswd) file is placed in a
96 directory with read and traverse access only to the root user and the
97 bf(smbpasswd) file itself must be set to be read/write only by root,
101 dit(bf(Account Flags)) nl() nl()
103 This section contains flags that describe the attributes of the users
104 account. In the bf(Samba2.0) release this field is bracketed by tt('[')
105 and tt(']') characters and is always 13 characters in length (including
106 the tt('[') and tt(']') characters). The contents of this field may be
107 any of the characters.
112 it() bf('U') This means this is a em("User") account, i.e. an ordinary
113 user. Only bf(User) and link(bf(Workstation Trust))(capW) accounts are
114 currently supported in the bf(smbpasswd) file.
117 it() bf('N') This means the account has em(no) password (the passwords
118 in the fields link(bf(Lanman Password Hash))(LanmanPasswordHash) and
119 link(bf(NT Password Hash))(NTPasswordHash) are ignored). Note that this
120 will only allow users to log on with no password if the
121 url(bf(null passwords))(smb.conf.5.html#nullpasswords) parameter is set
122 in the url(bf(smb.conf (5)))(smb.conf.5.html) config file.
125 it() bf('D') This means the account is disabled and no SMB/CIFS logins
126 will be allowed for this user.
129 it() bf('W') This means this account is a em("Workstation Trust") account.
130 This kind of account is used in the Samba PDC code stream to allow Windows
131 NT Workstations and Servers to join a Domain hosted by a Samba PDC.
135 Other flags may be added as the code is extended in future. The rest of
136 this field space is filled in with spaces.
138 label(LastChangeTime)
139 dit(bf(Last Change Time)) nl() nl()
141 This field consists of the time the account was last modified. It consists of
142 the characters tt(LCT-) (standing for em("Last Change Time")) followed by a numeric
143 encoding of the UNIX time in seconds since the epoch (1970) that the last change
146 dit(bf(Following fields)) nl() nl()
148 All other colon separated fields are ignored at this time.
153 manpagesection(NOTES)
155 In previous versions of Samba (notably the 1.9.18 series) this file
156 did not contain the link(bf(Account Flags))(AccountFlags) or
157 link(bf(Last Change Time))(LastChangeTime) fields. The Samba 2.0
158 code will read and write these older password files but will not be able to
159 modify the old entries to add the new fields. New entries added with
160 url(bf(smbpasswd (8)))(smbpasswd.8.html) will contain the new fields
161 in the added accounts however. Thus an older bf(smbpasswd) file used
162 with Samba 2.0 may end up with some accounts containing the new fields
165 In order to convert from an old-style bf(smbpasswd) file to a new
166 style, run the script bf(convert_smbpasswd), installed in the
167 Samba tt(bin/) directory (the same place that the url(bf(smbd))(smbd.8.html)
168 and url(bf(nmbd))(nmbd.8.html) binaries are installed) as follows:
172 cat old_smbpasswd_file | convert_smbpasswd > new_smbpasswd_file
176 The bf(convert_smbpasswd) script reads from stdin and writes to stdout
177 so as not to overwrite any files by accident.
179 Once this script has been run, check the contents of the new smbpasswd
180 file to ensure that it has not been damaged by the conversion script
181 (which uses bf(awk)), and then replace the tt(<old smbpasswd file>)
182 with the tt(<new smbpasswd file>).
185 manpagesection(VERSION)
187 This man page is correct for version 2.0 of the Samba suite.
192 url(bf(smbpasswd (8)))(smbpasswd.8.html), url(bf(samba
193 (7)))(samba.7.html), and the Internet RFC1321 for details on the MD4
199 The original Samba software and related utilities were created by
200 Andrew Tridgell email(samba-bugs@samba.org). Samba is now developed
201 by the Samba Team as an Open Source project similar to the way the
202 Linux kernel is developed.
204 The original Samba man pages were written by Karl Auer. The man page
205 sources were converted to YODL format (another excellent piece of Open
206 Source software, available at
207 url(bf(ftp://ftp.icce.rug.nl/pub/unix/))(ftp://ftp.icce.rug.nl/pub/unix/))
208 and updated for the Samba2.0 release by Jeremy
209 Allison, email(samba-bugs@samba.org).
211 See url(bf(samba (7)))(samba.7.html) to find out how to get a full
212 list of contributors and details on how to submit bug reports,