1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
2 <refentry id="smbpasswd.5">
5 <refentrytitle>smbpasswd</refentrytitle>
6 <manvolnum>5</manvolnum>
11 <refname>smbpasswd</refname>
12 <refpurpose>The Samba encrypted password file</refpurpose>
16 <para><filename>smbpasswd</filename></para>
20 <title>DESCRIPTION</title>
22 <para>This tool is part of the <citerefentry><refentrytitle>Samba</refentrytitle>
23 <manvolnum>7</manvolnum></citerefentry> suite.</para>
25 <para>smbpasswd is the Samba encrypted password file. It contains
26 the username, Unix user id and the SMB hashed passwords of the
27 user, as well as account flag information and the time the
28 password was last changed. This file format has been evolving with
29 Samba and has had several different formats in the past. </para>
33 <title>FILE FORMAT</title>
35 <para>The format of the smbpasswd file used by Samba 2.2
36 is very similar to the familiar Unix <filename>passwd(5)</filename>
37 file. It is an ASCII file containing one line for each user. Each field
38 ithin each line is separated from the next by a colon. Any entry
39 beginning with '#' is ignored. The smbpasswd file contains the
40 following information for each user: </para>
45 <listitem><para> This is the user name. It must be a name that
46 already exists in the standard UNIX passwd file. </para>
52 <listitem><para>This is the UNIX uid. It must match the uid
53 field for the same user entry in the standard UNIX passwd file.
54 If this does not match then Samba will refuse to recognize
55 this smbpasswd file entry as being valid for a user.
61 <term>Lanman Password Hash</term>
62 <listitem><para>This is the LANMAN hash of the user's password,
63 encoded as 32 hex digits. The LANMAN hash is created by DES
64 encrypting a well known string with the user's password as the
65 DES key. This is the same password used by Windows 95/98 machines.
66 Note that this password hash is regarded as weak as it is
67 vulnerable to dictionary attacks and if two users choose the
68 same password this entry will be identical (i.e. the password
69 is not "salted" as the UNIX password is). If the user has a
70 null password this field will contain the characters "NO PASSWORD"
71 as the start of the hex string. If the hex string is equal to
72 32 'X' characters then the user's account is marked as
73 <constant>disabled</constant> and the user will not be able to
74 log onto the Samba server. </para>
76 <para><emphasis>WARNING !!</emphasis> Note that, due to
77 the challenge-response nature of the SMB/CIFS authentication
78 protocol, anyone with a knowledge of this password hash will
79 be able to impersonate the user on the network. For this
80 reason these hashes are known as <emphasis>plain text
81 equivalents</emphasis> and must <emphasis>NOT</emphasis> be made
82 available to anyone but the root user. To protect these passwords
83 the smbpasswd file is placed in a directory with read and
84 traverse access only to the root user and the smbpasswd file
85 itself must be set to be read/write only by root, with no
86 other access. </para></listitem>
91 <term>NT Password Hash</term>
92 <listitem><para>This is the Windows NT hash of the user's
93 password, encoded as 32 hex digits. The Windows NT hash is
94 created by taking the user's password as represented in
95 16-bit, little-endian UNICODE and then applying the MD4
96 (internet rfc1321) hashing algorithm to it. </para>
98 <para>This password hash is considered more secure than
99 the LANMAN Password Hash as it preserves the case of the
100 password and uses a much higher quality hashing algorithm.
101 However, it is still the case that if two users choose the same
102 password this entry will be identical (i.e. the password is
103 not "salted" as the UNIX password is). </para>
105 <para><emphasis>WARNING !!</emphasis>. Note that, due to
106 the challenge-response nature of the SMB/CIFS authentication
107 protocol, anyone with a knowledge of this password hash will
108 be able to impersonate the user on the network. For this
109 reason these hashes are known as <emphasis>plain text
110 equivalents</emphasis> and must <emphasis>NOT</emphasis> be made
111 available to anyone but the root user. To protect these passwords
112 the smbpasswd file is placed in a directory with read and
113 traverse access only to the root user and the smbpasswd file
114 itself must be set to be read/write only by root, with no
115 other access. </para></listitem>
120 <term>Account Flags</term>
121 <listitem><para>This section contains flags that describe
122 the attributes of the users account. In the Samba 2.2 release
123 this field is bracketed by '[' and ']' characters and is always
124 13 characters in length (including the '[' and ']' characters).
125 The contents of this field may be any of the following characters:
129 <listitem><para><emphasis>U</emphasis> - This means
130 this is a "User" account, i.e. an ordinary user. Only User
131 and Workstation Trust accounts are currently supported
132 in the smbpasswd file. </para></listitem>
134 <listitem><para><emphasis>N</emphasis> - This means the
135 account has no password (the passwords in the fields LANMAN
136 Password Hash and NT Password Hash are ignored). Note that this
137 will only allow users to log on with no password if the <parameter>
138 null passwords</parameter> parameter is set in the <ulink
139 url="smb.conf.5.html#NULLPASSWORDS"><citerefentry><refentrytitle>smb.conf</refentrytitle>
140 <manvolnum>5</manvolnum></citerefentry></ulink> config file. </para></listitem>
142 <listitem><para><emphasis>D</emphasis> - This means the account
143 is disabled and no SMB/CIFS logins will be allowed for this user. </para></listitem>
145 <listitem><para><emphasis>W</emphasis> - This means this account
146 is a "Workstation Trust" account. This kind of account is used
147 in the Samba PDC code stream to allow Windows NT Workstations
148 and Servers to join a Domain hosted by a Samba PDC. </para>
152 <para>Other flags may be added as the code is extended in future.
153 The rest of this field space is filled in with spaces. </para>
159 <term>Last Change Time</term>
160 <listitem><para>This field consists of the time the account was
161 last modified. It consists of the characters 'LCT-' (standing for
162 "Last Change Time") followed by a numeric encoding of the UNIX time
163 in seconds since the epoch (1970) that the last change was made.
168 <para>All other colon separated fields are ignored at this time.</para>
172 <title>VERSION</title>
174 <para>This man page is correct for version 3.0 of
175 the Samba suite.</para>
179 <title>SEE ALSO</title>
180 <para><citerefentry><refentrytitle>smbpasswd</refentrytitle>
181 <manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>Samba</refentrytitle>
182 <manvolnum>7</manvolnum></citerefentry>, and
183 the Internet RFC1321 for details on the MD4 algorithm.
188 <title>AUTHOR</title>
190 <para>The original Samba software and related utilities
191 were created by Andrew Tridgell. Samba is now developed
192 by the Samba Team as an Open Source project similar
193 to the way the Linux kernel is developed.</para>
195 <para>The original Samba man pages were written by Karl Auer.
196 The man page sources were converted to YODL format (another
197 excellent piece of Open Source software, available at <ulink url="ftp://ftp.icce.rug.nl/pub/unix/">
198 ftp://ftp.icce.rug.nl/pub/unix/</ulink>) and updated for the Samba 2.0
199 release by Jeremy Allison. The conversion to DocBook for
200 Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2
201 for Samba 3.0 was done by Alexander Bokovoy.</para>