global change from samba.anu.edu.au to samba.org
[kai/samba-autobuild/.git] / docs / yodldocs / smbpasswd.5.yo
1 mailto(samba-bugs@samba.org) 
2
3 manpage(smbpasswd htmlcommand((5)))(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. If this does not
46         match then Samba will refuse to recognize this bf(smbpasswd) file entry
47         as being valid for a user.
48
49 label(LanmanPasswordHash)
50 dit(bf(Lanman Password Hash)) nl() nl()
51
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
63         server.
64
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,
73         with no other access.
74
75 label(NTPasswordHash)
76 dit(bf(NT Password Hash)) nl() nl()
77
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.
82
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
88         UNIX password is).
89
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,
98         with no other access.
99
100 label(AccountFlags)
101 dit(bf(Account Flags)) nl() nl()
102
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.
108
109                 startit()
110
111                 label(capU)
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.
115
116                 label(capN)
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.
123
124                 label(capD)
125                 it() bf('D') This means the account is disabled and no SMB/CIFS logins 
126                 will be allowed for this user.
127
128                 label(capW)
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.
132
133                 endit()
134
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.
137
138 label(LastChangeTime)
139 dit(bf(Last Change Time)) nl() nl()
140
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
144         was made.
145
146 dit(bf(Following fields)) nl() nl()
147
148         All other colon separated fields are ignored at this time.
149
150 enddit()
151
152 label(NOTES)
153 manpagesection(NOTES)
154
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
163 and some not.
164
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:
169
170 verb(
171
172     cat old_smbpasswd_file | convert_smbpasswd > new_smbpasswd_file
173
174 )
175
176 The bf(convert_smbpasswd) script reads from stdin and writes to stdout
177 so as not to overwrite any files by accident.
178
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>).
183
184 label(VERSION)
185 manpagesection(VERSION)
186
187 This man page is correct for version 2.0 of the Samba suite.
188
189 label(SEEALSO)
190 manpageseealso()
191
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
194 algorithm.
195
196 label(AUTHOR)
197 manpageauthor()
198
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.
203
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).
210
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,
213 comments etc.