Up to "magic script".
[samba.git] / docs / yodldocs / smbpasswd.5.yo
1 mailto(samba-bugs@samba.anu.edu.au) 
2
3 manpage(smbpasswd)(5)(23 Oct 1998)(Samba)(SAMBA)
4
5 label(NAME)
6 manpagename(smbpasswd)(The Samba encrypted password file)
7
8 label(SYNOPSIS)
9 manpagesynopsis() 
10
11 smbpasswd is the bf(Samba) encrypted password file.
12
13 label(DESCRIPTION)
14 manpagedescription()
15
16 This file is part of the bf(Samba) suite.
17
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.
23
24 label(FILEFORMAT)
25 manpagesection(FILE FORMAT)
26
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:
32
33 startit()
34
35 label(name)
36 dit(bf(name)) nl() nl()
37
38         This is the user name. It must be a name that already exists
39         in the standard UNIX passwd file.
40
41 label(uid)
42 dit(bf(uid)) nl() nl()
43
44         This is the UNIX uid. It must match the uid field for the same
45         user entry in the standard UNIX passwd file.
46
47 label(LanmanPasswordHash)
48 dit(bf(Lanman Password Hash)) nl() nl()
49
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
61         server.
62
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,
71         with no other access.
72
73 label(NTPasswordHash)
74 dit(bf(NT Password Hash)) nl() nl()
75
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.
80
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
86         UNIX password is).
87
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,
96         with no other access.
97
98 label(AccountFlags)
99 dit(bf(Account Flags)) nl() nl()
100
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.
106
107                 startit()
108
109                 label(capU)
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.
113
114                 label(capN)
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.
121
122                 label(capD)
123                 it() bf('D') This means the account is diabled and no SMB/CIFS logins 
124                 will be allowed for this user.
125
126                 label(capW)
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.
130
131                 endit()
132
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.
135
136 label(LastChangeTime)
137 dit(bf(Last Change Time)) nl() nl()
138
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
142         was made.
143
144 dit(bf(Following fields)) nl() nl()
145
146         All other colon separated fields are ignored at this time.
147
148 enddit()
149
150 label(NOTES)
151 manpagesection(NOTES)
152
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
161 and some not.
162
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:
167
168 verb(
169
170     cat old_smbpasswd_file | convert_smbpasswd > new_smbpasswd_file
171
172 )
173
174 The bf(convert_smbpasswd) script reads from stdin and writes to stdout
175 so as not to overwrite any files by accident.
176
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>).
181
182 label(VERSION)
183 manpagesection(VERSION)
184
185 This man page is correct for version 2.0 of the Samba suite.
186
187 label(SEEALSO)
188 manpageseealso()
189
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
192 algorithm.
193
194 label(AUTHOR)
195 manpageauthor()
196
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.
201
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).
206
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,
209 comments etc.