1SMBPASSWD(5) File Formats and Conventions SMBPASSWD(5)
2
3
4
6 smbpasswd - The Samba encrypted password file
7
9 smbpasswd
10
12 This tool is part of the samba(7) suite.
13
14 smbpasswd is the Samba encrypted password file. It contains the
15 username, Unix user id and the SMB hashed passwords of the user, as
16 well as account flag information and the time the password was last
17 changed. This file format has been evolving with Samba and has had
18 several different formats in the past.
19
21 The format of the smbpasswd file used by Samba 2.2 is very similar to
22 the familiar Unix passwd(5) file. It is an ASCII file containing one
23 line for each user. Each field ithin each line is separated from the
24 next by a colon. Any entry beginning with '#' is ignored. The smbpasswd
25 file contains the following information for each user:
26
27 name
28 This is the user name. It must be a name that already exists in the
29 standard UNIX passwd file.
30
31 uid
32 This is the UNIX uid. It must match the uid field for the same user
33 entry in the standard UNIX passwd file. If this does not match then
34 Samba will refuse to recognize this smbpasswd file entry as being
35 valid for a user.
36
37 Lanman Password Hash
38 This is the LANMAN hash of the user's password, encoded as 32 hex
39 digits. The LANMAN hash is created by DES encrypting a well known
40 string with the user's password as the DES key. This is the same
41 password used by Windows 95/98 machines. Note that this password
42 hash is regarded as weak as it is vulnerable to dictionary attacks
43 and if two users choose the same password this entry will be
44 identical (i.e. the password is not "salted" as the UNIX password
45 is). If the user has a null password this field will contain the
46 characters "NO PASSWORD" as the start of the hex string. If the hex
47 string is equal to 32 'X' characters then the user's account is
48 marked as disabled and the user will not be able to log onto the
49 Samba server.
50
51 WARNING !! Note that, due to the challenge-response nature of the
52 SMB/CIFS authentication protocol, anyone with a knowledge of this
53 password hash will be able to impersonate the user on the network.
54 For this reason these hashes are known as plain text equivalents
55 and must NOT be made available to anyone but the root user. To
56 protect these passwords the smbpasswd file is placed in a directory
57 with read and traverse access only to the root user and the
58 smbpasswd file itself must be set to be read/write only by root,
59 with no other access.
60
61 NT Password Hash
62 This is the Windows NT hash of the user's password, encoded as 32
63 hex digits. The Windows NT hash is created by taking the user's
64 password as represented in 16-bit, little-endian UNICODE and then
65 applying the MD4 (internet rfc1321) hashing algorithm to it.
66
67 This password hash is considered more secure than the LANMAN
68 Password Hash as it preserves the case of the password and uses a
69 much higher quality hashing algorithm. However, it is still the
70 case that if two users choose the same password this entry will be
71 identical (i.e. the password is not "salted" as the UNIX password
72 is).
73
74 WARNING !!. Note that, due to the challenge-response nature of the
75 SMB/CIFS authentication protocol, anyone with a knowledge of this
76 password hash will be able to impersonate the user on the network.
77 For this reason these hashes are known as plain text equivalents
78 and must NOT be made available to anyone but the root user. To
79 protect these passwords the smbpasswd file is placed in a directory
80 with read and traverse access only to the root user and the
81 smbpasswd file itself must be set to be read/write only by root,
82 with no other access.
83
84 Account Flags
85 This section contains flags that describe the attributes of the
86 users account. This field is bracketed by '[' and ']' characters
87 and is always 13 characters in length (including the '[' and ']'
88 characters). The contents of this field may be any of the following
89 characters:
90
91 · U - This means this is a "User" account, i.e. an ordinary user.
92
93 · N - This means the account has no password (the passwords in
94 the fields LANMAN Password Hash and NT Password Hash are
95 ignored). Note that this will only allow users to log on with
96 no password if the
97 null passwords parameter is set in the smb.conf(5) config
98 file.
99
100 · D - This means the account is disabled and no SMB/CIFS logins
101 will be allowed for this user.
102
103 · X - This means the password does not expire.
104
105 · W - This means this account is a "Workstation Trust" account.
106 This kind of account is used in the Samba PDC code stream to
107 allow Windows NT Workstations and Servers to join a Domain
108 hosted by a Samba PDC.
109
110 Other flags may be added as the code is extended in future. The rest of
111 this field space is filled in with spaces. For further information
112 regarding the flags that are supported please refer to the man page for
113 the pdbedit command.
114
115 Last Change Time
116 This field consists of the time the account was last modified. It
117 consists of the characters 'LCT-' (standing for "Last Change Time")
118 followed by a numeric encoding of the UNIX time in seconds since
119 the epoch (1970) that the last change was made.
120
121 All other colon separated fields are ignored at this time.
122
124 This man page is correct for version 3 of the Samba suite.
125
127 smbpasswd(8), Samba(7), and the Internet RFC1321 for details on the MD4
128 algorithm.
129
131 The original Samba software and related utilities were created by
132 Andrew Tridgell. Samba is now developed by the Samba Team as an Open
133 Source project similar to the way the Linux kernel is developed.
134
135 The original Samba man pages were written by Karl Auer. The man page
136 sources were converted to YODL format (another excellent piece of Open
137 Source software, available at ftp://ftp.icce.rug.nl/pub/unix/) and
138 updated for the Samba 2.0 release by Jeremy Allison. The conversion to
139 DocBook for Samba 2.2 was done by Gerald Carter. The conversion to
140 DocBook XML 4.2 for Samba 3.0 was done by Alexander Bokovoy.
141
142
143
144Samba 3.6 04/11/2016 SMBPASSWD(5)