Debian Codegraph @

upstream/debian-unstable/man5/smbpasswd.5

raw
1 '\" t
2 .\" Title: smbpasswd
3 .\" Author: [see the "AUTHOR" section]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\" Date: 05/26/2026
6 .\" Manual: File Formats and Conventions
7 .\" Source: Samba 4.24.3-Debian-4.24.3+dfsg-1
8 .\" Language: English
9 .\"
10 .TH "SMBPASSWD" "5" "05/26/2026" "Samba 4\&.24\&.3\-Debian\-4\&.24\&.3+dfs" "File Formats and Conventions"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 smbpasswd \- The Samba encrypted password file
32 .SH "SYNOPSIS"
33 .PP
34 smbpasswd
35 .SH "DESCRIPTION"
36 .PP
37 This tool is part of the
38 \fBsamba\fR(7)
39 suite\&.
40 .PP
41 smbpasswd is the Samba encrypted password file\&. It contains the username, Unix user id and the SMB hashed passwords of the user, as well as account flag information and the time the password was last changed\&. This file format has been evolving with Samba and has had several different formats in the past\&.
42 .SH "FILE FORMAT"
43 .PP
44 The format of the smbpasswd file used by Samba 2\&.2 is very similar to the familiar Unix
45 passwd(5)
46 file\&. It is an ASCII file containing one line for each user\&. Each field within each line is separated from the next by a colon\&. Any entry beginning with \*(Aq#\*(Aq is ignored\&. The smbpasswd file contains the following information for each user:
47 .PP
48 name
49 .RS 4
50 This is the user name\&. It must be a name that already exists in the standard UNIX passwd file\&.
51 .RE
52 .PP
53 uid
54 .RS 4
55 This is the UNIX uid\&. It must match the uid field for the same user entry in the standard UNIX passwd file\&. If this does not match then Samba will refuse to recognize this smbpasswd file entry as being valid for a user\&.
56 .RE
57 .PP
58 Lanman Password Hash
59 .RS 4
60 This is the LANMAN hash of the user\*(Aqs password, encoded as 32 hex digits\&. The LANMAN hash is created by DES encrypting a well known string with the user\*(Aqs password as the DES key\&. This is the same password used by Windows 95/98 machines\&. Note that this password hash is regarded as weak as it is vulnerable to dictionary attacks and if two users choose the same password this entry will be identical (i\&.e\&. the password is not "salted" as the UNIX password is)\&. If the user has a null password this field will contain the characters "NO PASSWORD" as the start of the hex string\&. If the hex string is equal to 32 \*(AqX\*(Aq characters then the user\*(Aqs account is marked as
61 \fBdisabled\fR
62 and the user will not be able to log onto the Samba server\&.
63 .sp
64 \fIWARNING !!\fR
65 Note that, due to the challenge\-response nature of the SMB/CIFS authentication protocol, anyone with a knowledge of this password hash will be able to impersonate the user on the network\&. For this reason these hashes are known as
66 \fIplain text equivalents\fR
67 and must
68 \fINOT\fR
69 be made available to anyone but the root user\&. To protect these passwords the smbpasswd file is placed in a directory with read and traverse access only to the root user and the smbpasswd file itself must be set to be read/write only by root, with no other access\&.
70 .RE
71 .PP
72 NT Password Hash
73 .RS 4
74 This is the Windows NT hash of the user\*(Aqs password, encoded as 32 hex digits\&. The Windows NT hash is created by taking the user\*(Aqs password as represented in 16\-bit, little\-endian UNICODE and then applying the MD4 (internet rfc1321) hashing algorithm to it\&.
75 .sp
76 This password hash is considered more secure than the LANMAN Password Hash as it preserves the case of the password and uses a much higher quality hashing algorithm\&. However, it is still the case that if two users choose the same password this entry will be identical (i\&.e\&. the password is not "salted" as the UNIX password is)\&.
77 .sp
78 \fIWARNING !!\fR\&. Note that, due to the challenge\-response nature of the SMB/CIFS authentication protocol, anyone with a knowledge of this password hash will be able to impersonate the user on the network\&. For this reason these hashes are known as
79 \fIplain text equivalents\fR
80 and must
81 \fINOT\fR
82 be made available to anyone but the root user\&. To protect these passwords the smbpasswd file is placed in a directory with read and traverse access only to the root user and the smbpasswd file itself must be set to be read/write only by root, with no other access\&.
83 .RE
84 .PP
85 Account Flags
86 .RS 4
87 This section contains flags that describe the attributes of the users account\&. This field is bracketed by \*(Aq[\*(Aq and \*(Aq]\*(Aq characters and is always 13 characters in length (including the \*(Aq[\*(Aq and \*(Aq]\*(Aq characters)\&. The contents of this field may be any of the following characters:
88 .RS
89 .sp
90 .RS 4
91 .ie n \{\
92 \h'-04'\(bu\h'+03'\c
93 .\}
94 .el \{\
95 .sp -1
96 .IP \(bu 2.3
97 .\}
98 \fIU\fR
99 \- This means this is a "User" account, i\&.e\&. an ordinary user\&.
100 .RE
101 .sp
102 .RS 4
103 .ie n \{\
104 \h'-04'\(bu\h'+03'\c
105 .\}
106 .el \{\
107 .sp -1
108 .IP \(bu 2.3
109 .\}
110 \fIN\fR
111 \- This means the account has no password (the passwords in the fields LANMAN Password Hash and NT Password Hash are ignored)\&. Note that this will only allow users to log on with no password if the
112 \fI null passwords\fR
113 parameter is set in the
114 \fBsmb.conf\fR(5)
115 config file\&.
116 .RE
117 .sp
118 .RS 4
119 .ie n \{\
120 \h'-04'\(bu\h'+03'\c
121 .\}
122 .el \{\
123 .sp -1
124 .IP \(bu 2.3
125 .\}
126 \fID\fR
127 \- This means the account is disabled and no SMB/CIFS logins will be allowed for this user\&.
128 .RE
129 .sp
130 .RS 4
131 .ie n \{\
132 \h'-04'\(bu\h'+03'\c
133 .\}
134 .el \{\
135 .sp -1
136 .IP \(bu 2.3
137 .\}
138 \fIX\fR
139 \- This means the password does not expire\&.
140 .RE
141 .sp
142 .RS 4
143 .ie n \{\
144 \h'-04'\(bu\h'+03'\c
145 .\}
146 .el \{\
147 .sp -1
148 .IP \(bu 2.3
149 .\}
150 \fIW\fR
151 \- This means this account is a "Workstation Trust" account\&. This kind of account is used in the Samba PDC code stream to allow Windows NT Workstations and Servers to join a Domain hosted by a Samba PDC\&.
152 .RE
153 .sp
154 .RE
155 Other flags may be added as the code is extended in future\&. The rest of this field space is filled in with spaces\&. For further information regarding the flags that are supported please refer to the man page for the
156 pdbedit
157 command\&.
158 .RE
159 .PP
160 Last Change Time
161 .RS 4
162 This field consists of the time the account was last modified\&. It consists of the characters \*(AqLCT\-\*(Aq (standing for "Last Change Time") followed by a numeric encoding of the UNIX time in seconds since the epoch (1970) that the last change was made\&.
163 .RE
164 .PP
165 All other colon separated fields are ignored at this time\&.
166 .SH "VERSION"
167 .PP
168 This man page is part of version 4\&.24\&.3\-Debian\-4\&.24\&.3+dfsg\-1 of the Samba suite\&.
169 .SH "SEE ALSO"
170 .PP
171 \fBsmbpasswd\fR(8),
172 \fBSamba\fR(7), and the Internet RFC1321 for details on the MD4 algorithm\&.
173 .SH "AUTHOR"
174 .PP
175 The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.