1mailto(samba@samba.org) 2 3manpage(smbpasswd htmlcommand((5)))(5)(23 Oct 1998)(Samba)(SAMBA) 4 5label(NAME) 6manpagename(smbpasswd)(The Samba encrypted password file) 7 8label(SYNOPSIS) 9manpagesynopsis() 10 11smbpasswd is the bf(Samba) encrypted password file. 12 13label(DESCRIPTION) 14manpagedescription() 15 16This file is part of the bf(Samba) suite. 17 18smbpasswd is the bf(Samba) encrypted password file. It contains 19the username, Unix user id and the SMB hashed passwords of the 20user, as well as account flag information and the time the password 21was last changed. This file format has been evolving with Samba 22and has had several different formats in the past. 23 24label(FILEFORMAT) 25manpagesection(FILE FORMAT) 26 27The format of the smbpasswd file used by Samba 2.0 is very similar to 28the familiar Unix bf(passwd (5)) file. It is an ASCII file containing 29one line for each user. Each field within each line is separated from 30the next by a colon. Any entry beginning with # is ignored. The 31smbpasswd file contains the following information for each user: 32 33startit() 34 35label(name) 36dit(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 41label(uid) 42dit(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 49label(LanmanPasswordHash) 50dit(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 75label(NTPasswordHash) 76dit(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 100label(AccountFlags) 101dit(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 138label(LastChangeTime) 139dit(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 146dit(bf(Following fields)) nl() nl() 147 148 All other colon separated fields are ignored at this time. 149 150enddit() 151 152label(NOTES) 153manpagesection(NOTES) 154 155In previous versions of Samba (notably the 1.9.18 series) this file 156did not contain the link(bf(Account Flags))(AccountFlags) or 157link(bf(Last Change Time))(LastChangeTime) fields. The Samba 2.0 158code will read and write these older password files but will not be able to 159modify the old entries to add the new fields. New entries added with 160url(bf(smbpasswd (8)))(smbpasswd.8.html) will contain the new fields 161in the added accounts however. Thus an older bf(smbpasswd) file used 162with Samba 2.0 may end up with some accounts containing the new fields 163and some not. 164 165In order to convert from an old-style bf(smbpasswd) file to a new 166style, run the script bf(convert_smbpasswd), installed in the 167Samba tt(bin/) directory (the same place that the url(bf(smbd))(smbd.8.html) 168and url(bf(nmbd))(nmbd.8.html) binaries are installed) as follows: 169 170verb( 171 172 cat old_smbpasswd_file | convert_smbpasswd > new_smbpasswd_file 173 174) 175 176The bf(convert_smbpasswd) script reads from stdin and writes to stdout 177so as not to overwrite any files by accident. 178 179Once this script has been run, check the contents of the new smbpasswd 180file 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>) 182with the tt(<new smbpasswd file>). 183 184label(VERSION) 185manpagesection(VERSION) 186 187This man page is correct for version 2.0 of the Samba suite. 188 189label(SEEALSO) 190manpageseealso() 191 192url(bf(smbpasswd (8)))(smbpasswd.8.html), url(bf(samba 193(7)))(samba.7.html), and the Internet RFC1321 for details on the MD4 194algorithm. 195 196label(AUTHOR) 197manpageauthor() 198 199The original Samba software and related utilities were created by 200Andrew Tridgell email(samba@samba.org). Samba is now developed 201by the Samba Team as an Open Source project similar to the way the 202Linux kernel is developed. 203 204The original Samba man pages were written by Karl Auer. The man page 205sources were converted to YODL format (another excellent piece of Open 206Source software, available at 207url(bf(ftp://ftp.icce.rug.nl/pub/unix/))(ftp://ftp.icce.rug.nl/pub/unix/)) 208and updated for the Samba2.0 release by Jeremy 209Allison, email(samba@samba.org). 210 211See url(bf(samba (7)))(samba.7.html) to find out how to get a full 212list of contributors and details on how to submit bug reports, 213comments etc. 214