preparing for release of alpha.2.5.2
[Samba.git] / docs / manpages / smbpasswd.5
blob9d63f8fd127451d4a5ca154d66b58d73923d1a3f
1 .TH SMBPASSWD 5 "02 May 2000" "smbpasswd TNG-alpha"
2 .PP 
3 .SH "NAME" 
4 smbpasswd \- The Samba encrypted password file
5 .PP 
6 .SH "SYNOPSIS" 
7 .PP 
8 smbpasswd is the \fBSamba\fP encrypted password file\&.
9 .PP 
10 .SH "DESCRIPTION" 
11 .PP 
12 This file is part of the \fBSamba\fP suite\&.
13 .PP 
14 smbpasswd is the \fBSamba\fP encrypted password file\&. It contains
15 the username, Unix user id and the SMB hashed passwords of the
16 user, as well as account flag information and the time the password
17 was last changed\&. This file format has been evolving with Samba
18 and has had several different formats in the past\&.
19 .PP 
20 .SH "FILE FORMAT" 
21 .PP 
22 The format of the smbpasswd file used by Samba 2\&.0 is very similar to
23 the familiar Unix \fBpasswd (5)\fP file\&. It is an ASCII file containing
24 one line for each user\&. Each field within each line is separated from
25 the next by a colon\&. Any entry beginning with # is ignored\&. The
26 smbpasswd file contains the following information for each user:
27 .PP 
28 .IP 
29 .IP "\fBname\fP" 
30 .br 
31 .br 
32 .IP 
33 This is the user name\&. It must be a name that already exists
34 in the standard UNIX passwd file\&.
35 .IP 
36 .IP "\fBuid\fP" 
37 .br 
38 .br 
39 .IP 
40 This is the UNIX uid\&. It must match the uid field for the same
41 user entry in the standard UNIX passwd file\&. If this does not
42 match then Samba will refuse to recognize this \fBsmbpasswd\fP file entry
43 as being valid for a user\&.
44 .IP 
45 .IP "\fBLanman Password Hash\fP" 
46 .br 
47 .br 
48 .IP 
49 This is the \fILANMAN\fP hash of the users password, encoded as 32 hex
50 digits\&. The \fILANMAN\fP hash is created by DES encrypting a well known
51 string with the users password as the DES key\&. This is the same
52 password used by Windows 95/98 machines\&. Note that this password hash
53 is regarded as weak as it is vulnerable to dictionary attacks and if
54 two users choose the same password this entry will be identical (i\&.e\&.
55 the password is not \fI"salted"\fP as the UNIX password is)\&. If the
56 user has a null password this field will contain the characters
57 \f(CW"NO PASSWORD"\fP as the start of the hex string\&. If the hex string
58 is equal to 32 \f(CW\'X\'\fP characters then the users account is marked as
59 \fIdisabled\fP and the user will not be able to log onto the Samba
60 server\&.
61 .IP 
62 \fIWARNING !!\fP\&. Note that, due to the challenge-response nature of the
63 SMB/CIFS authentication protocol, anyone with a knowledge of this
64 password hash will be able to impersonate the user on the network\&.
65 For this reason these hashes are known as \fI"plain text equivalent"\fP
66 and must \fINOT\fP be made available to anyone but the root user\&. To
67 protect these passwords the \fBsmbpasswd\fP file is placed in a
68 directory with read and traverse access only to the root user and the
69 \fBsmbpasswd\fP file itself must be set to be read/write only by root,
70 with no other access\&.
71 .IP 
72 .IP "\fBNT Password Hash\fP" 
73 .br 
74 .br 
75 .IP 
76 This is the \fIWindows NT\fP hash of the users password, encoded as 32
77 hex digits\&. The \fIWindows NT\fP hash is created by taking the users
78 password as represented in 16-bit, little-endian UNICODE and then
79 applying the \fIMD4\fP (internet rfc1321) hashing algorithm to it\&.
80 .IP 
81 This password hash is considered more secure than the \fBLanman
82 Password Hash\fP 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 (i\&.e\&. the password is not \fI"salted"\fP as the
86 UNIX password is)\&.
87 .IP 
88 \fIWARNING !!\fP\&. 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 on the network\&.
91 For this reason these hashes are known as \fI"plain text equivalent"\fP
92 and must \fINOT\fP be made available to anyone but the root user\&. To
93 protect these passwords the \fBsmbpasswd\fP file is placed in a
94 directory with read and traverse access only to the root user and the
95 \fBsmbpasswd\fP file itself must be set to be read/write only by root,
96 with no other access\&.
97 .IP 
98 .IP "\fBAccount Flags\fP" 
99 .br 
100 .br 
101 .IP 
102 This section contains flags that describe the attributes of the users
103 account\&. In the \fBSamba2\&.0\fP release this field is bracketed by \f(CW\'[\'\fP
104 and \f(CW\']\'\fP characters and is always 13 characters in length (including
105 the \f(CW\'[\'\fP and \f(CW\']\'\fP characters)\&. The contents of this field may be
106 any of the characters\&.
107 .IP 
108 .IP 
109 .IP o 
110 \fB\'U\'\fP This means this is a \fI"User"\fP account, i\&.e\&. an ordinary
111 user\&. Only \fBUser\fP and \fBWorkstation Trust\fP accounts are
112 currently supported in the \fBsmbpasswd\fP file\&.
113 .IP 
114 .IP o 
115 \fB\'N\'\fP This means the account has \fIno\fP password (the passwords
116 in the fields \fBLanman Password Hash\fP and
117 \fBNT Password Hash\fP are ignored)\&. Note that this
118 will only allow users to log on with no password if the 
119 \fBnull passwords\fP parameter is set
120 in the \fBsmb\&.conf (5)\fP config file\&.
121 .IP 
122 .IP o 
123 \fB\'D\'\fP This means the account is disabled and no SMB/CIFS logins 
124 will be allowed for this user\&.
125 .IP 
126 .IP o 
127 \fB\'W\'\fP This means this account is a \fI"Workstation Trust"\fP 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 .IP 
131 .IP 
132 Other flags may be added as the code is extended in future\&. The rest of
133 this field space is filled in with spaces\&.
134 .IP 
135 .IP "\fBLast Change Time\fP" 
136 .br 
137 .br 
138 .IP 
139 This field consists of the time the account was last modified\&. It consists of
140 the characters \f(CWLCT-\fP (standing for \fI"Last Change Time"\fP) followed by a numeric
141 encoding of the UNIX time in seconds since the epoch (1970) that the last change
142 was made\&.
143 .IP 
144 .IP "\fBFollowing fields\fP" 
145 .br 
146 .br 
147 .IP 
148 All other colon separated fields are ignored at this time\&.
149 .IP 
150 .PP 
151 .SH "NOTES" 
152 .PP 
153 In previous versions of Samba (notably the 1\&.9\&.18 series) this file
154 did not contain the \fBAccount Flags\fP or 
155 \fBLast Change Time\fP 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 \fBsmbpasswd (8)\fP will contain the new fields
159 in the added accounts however\&. Thus an older \fBsmbpasswd\fP file used
160 with Samba 2\&.0 may end up with some accounts containing the new fields
161 and some not\&.
162 .PP 
163 In order to convert from an old-style \fBsmbpasswd\fP file to a new
164 style, run the script \fBconvert_smbpasswd\fP, installed in the
165 Samba \f(CWbin/\fP directory (the same place that the \fBsmbd\fP
166 and \fBnmbd\fP binaries are installed) as follows:
167 .PP 
169 .DS 
173     cat old_smbpasswd_file | convert_smbpasswd > new_smbpasswd_file
176 .DE 
179 .PP 
180 The \fBconvert_smbpasswd\fP script reads from stdin and writes to stdout
181 so as not to overwrite any files by accident\&.
182 .PP 
183 Once this script has been run, check the contents of the new smbpasswd
184 file to ensure that it has not been damaged by the conversion script
185 (which uses \fBawk\fP), and then replace the \f(CW<old smbpasswd file>\fP
186 with the \f(CW<new smbpasswd file>\fP\&.
187 .PP 
188 .SH "VERSION" 
189 .PP 
190 This man page is correct for version 2\&.0 of the Samba suite\&.
191 .PP 
192 .SH "SEE ALSO" 
193 .PP 
194 \fBsmbpasswd (8)\fP, \fBsamba
195 (7)\fP, and the Internet RFC1321 for details on the MD4
196 algorithm\&.
197 .PP 
198 .SH "AUTHOR" 
199 .PP 
200 The original Samba software and related utilities were created by
201 Andrew Tridgell \fIsamba-bugs@samba\&.org\fP\&. Samba is now developed
202 by the Samba Team as an Open Source project similar to the way the
203 Linux kernel is developed\&.
204 .PP 
205 The original Samba man pages were written by Karl Auer\&. The man page
206 sources were converted to YODL format (another excellent piece of Open
207 Source software, available at
208 \fBftp://ftp\&.icce\&.rug\&.nl/pub/unix/\fP) 
209 and updated for the Samba2\&.0 release by Jeremy
210 Allison, \fIsamba-bugs@samba\&.org\fP\&.
211 .PP 
212 See \fBsamba (7)\fP to find out how to get a full
213 list of contributors and details on how to submit bug reports,
214 comments etc\&.