| 1 | '\" t
|
|---|
| 2 | .\" Title: ntlm_auth
|
|---|
| 3 | .\" Author: [see the "AUTHOR" section]
|
|---|
| 4 | .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
|
|---|
| 5 | .\" Date: 03/06/2011
|
|---|
| 6 | .\" Manual: User Commands
|
|---|
| 7 | .\" Source: Samba 3.5
|
|---|
| 8 | .\" Language: English
|
|---|
| 9 | .\"
|
|---|
| 10 | .TH "NTLM_AUTH" "1" "03/06/2011" "Samba 3\&.5" "User Commands"
|
|---|
| 11 | .\" -----------------------------------------------------------------
|
|---|
| 12 | .\" * set default formatting
|
|---|
| 13 | .\" -----------------------------------------------------------------
|
|---|
| 14 | .\" disable hyphenation
|
|---|
| 15 | .nh
|
|---|
| 16 | .\" disable justification (adjust text to left margin only)
|
|---|
| 17 | .ad l
|
|---|
| 18 | .\" -----------------------------------------------------------------
|
|---|
| 19 | .\" * MAIN CONTENT STARTS HERE *
|
|---|
| 20 | .\" -----------------------------------------------------------------
|
|---|
| 21 | .SH "NAME"
|
|---|
| 22 | ntlm_auth \- tool to allow external access to Winbind\'s NTLM authentication function
|
|---|
| 23 | .SH "SYNOPSIS"
|
|---|
| 24 | .HP \w'\ 'u
|
|---|
| 25 | ntlm_auth [\-d\ debuglevel] [\-l\ logdir] [\-s\ <smb\ config\ file>]
|
|---|
| 26 | .SH "DESCRIPTION"
|
|---|
| 27 | .PP
|
|---|
| 28 | This tool is part of the
|
|---|
| 29 | \fBsamba\fR(7)
|
|---|
| 30 | suite\&.
|
|---|
| 31 | .PP
|
|---|
| 32 | ntlm_auth
|
|---|
| 33 | is a helper utility that authenticates users using NT/LM authentication\&. It returns 0 if the users is authenticated successfully and 1 if access was denied\&. ntlm_auth uses winbind to access the user and authentication data for a domain\&. This utility is only intended to be used by other programs (currently
|
|---|
| 34 | Squid
|
|---|
| 35 | and
|
|---|
| 36 | mod_ntlm_winbind)
|
|---|
| 37 | .SH "OPERATIONAL REQUIREMENTS"
|
|---|
| 38 | .PP
|
|---|
| 39 | The
|
|---|
| 40 | \fBwinbindd\fR(8)
|
|---|
| 41 | daemon must be operational for many of these commands to function\&.
|
|---|
| 42 | .PP
|
|---|
| 43 | Some of these commands also require access to the directory
|
|---|
| 44 | winbindd_privileged
|
|---|
| 45 | in
|
|---|
| 46 | $LOCKDIR\&. This should be done either by running this command as root or providing group access to the
|
|---|
| 47 | winbindd_privileged
|
|---|
| 48 | directory\&. For security reasons, this directory should not be world\-accessable\&.
|
|---|
| 49 | .SH "OPTIONS"
|
|---|
| 50 | .PP
|
|---|
| 51 | \-\-helper\-protocol=PROTO
|
|---|
| 52 | .RS 4
|
|---|
| 53 | Operate as a stdio\-based helper\&. Valid helper protocols are:
|
|---|
| 54 | .PP
|
|---|
| 55 | squid\-2\&.4\-basic
|
|---|
| 56 | .RS 4
|
|---|
| 57 | Server\-side helper for use with Squid 2\&.4\'s basic (plaintext) authentication\&.
|
|---|
| 58 | .RE
|
|---|
| 59 | .PP
|
|---|
| 60 | squid\-2\&.5\-basic
|
|---|
| 61 | .RS 4
|
|---|
| 62 | Server\-side helper for use with Squid 2\&.5\'s basic (plaintext) authentication\&.
|
|---|
| 63 | .RE
|
|---|
| 64 | .PP
|
|---|
| 65 | squid\-2\&.5\-ntlmssp
|
|---|
| 66 | .RS 4
|
|---|
| 67 | Server\-side helper for use with Squid 2\&.5\'s NTLMSSP authentication\&.
|
|---|
| 68 | .sp
|
|---|
| 69 | Requires access to the directory
|
|---|
| 70 | winbindd_privileged
|
|---|
| 71 | in
|
|---|
| 72 | $LOCKDIR\&. The protocol used is described here:
|
|---|
| 73 | http://devel\&.squid\-cache\&.org/ntlm/squid_helper_protocol\&.html\&. This protocol has been extended to allow the NTLMSSP Negotiate packet to be included as an argument to the
|
|---|
| 74 | YR
|
|---|
| 75 | command\&. (Thus avoiding loss of information in the protocol exchange)\&.
|
|---|
| 76 | .RE
|
|---|
| 77 | .PP
|
|---|
| 78 | ntlmssp\-client\-1
|
|---|
| 79 | .RS 4
|
|---|
| 80 | Client\-side helper for use with arbitrary external programs that may wish to use Samba\'s NTLMSSP authentication knowledge\&.
|
|---|
| 81 | .sp
|
|---|
| 82 | This helper is a client, and as such may be run by any user\&. The protocol used is effectively the reverse of the previous protocol\&. A
|
|---|
| 83 | YR
|
|---|
| 84 | command (without any arguments) starts the authentication exchange\&.
|
|---|
| 85 | .RE
|
|---|
| 86 | .PP
|
|---|
| 87 | gss\-spnego
|
|---|
| 88 | .RS 4
|
|---|
| 89 | Server\-side helper that implements GSS\-SPNEGO\&. This uses a protocol that is almost the same as
|
|---|
| 90 | squid\-2\&.5\-ntlmssp, but has some subtle differences that are undocumented outside the source at this stage\&.
|
|---|
| 91 | .sp
|
|---|
| 92 | Requires access to the directory
|
|---|
| 93 | winbindd_privileged
|
|---|
| 94 | in
|
|---|
| 95 | $LOCKDIR\&.
|
|---|
| 96 | .RE
|
|---|
| 97 | .PP
|
|---|
| 98 | gss\-spnego\-client
|
|---|
| 99 | .RS 4
|
|---|
| 100 | Client\-side helper that implements GSS\-SPNEGO\&. This also uses a protocol similar to the above helpers, but is currently undocumented\&.
|
|---|
| 101 | .RE
|
|---|
| 102 | .PP
|
|---|
| 103 | ntlm\-server\-1
|
|---|
| 104 | .RS 4
|
|---|
| 105 | Server\-side helper protocol, intended for use by a RADIUS server or the \'winbind\' plugin for pppd, for the provision of MSCHAP and MSCHAPv2 authentication\&.
|
|---|
| 106 | .sp
|
|---|
| 107 | This protocol consists of lines in the form:
|
|---|
| 108 | Parameter: value
|
|---|
| 109 | and
|
|---|
| 110 | Parameter:: Base64\-encode value\&. The presence of a single period
|
|---|
| 111 | \&.
|
|---|
| 112 | indicates that one side has finished supplying data to the other\&. (Which in turn could cause the helper to authenticate the user)\&.
|
|---|
| 113 | .sp
|
|---|
| 114 | Curently implemented parameters from the external program to the helper are:
|
|---|
| 115 | .PP
|
|---|
| 116 | Username
|
|---|
| 117 | .RS 4
|
|---|
| 118 | The username, expected to be in Samba\'s
|
|---|
| 119 | \m[blue]\fBunix charset\fR\m[]\&.
|
|---|
| 120 | .PP \fBExample\ \&1.\ \&\fR Username: bob
|
|---|
| 121 | .PP \fBExample\ \&2.\ \&\fR Username:: Ym9i
|
|---|
| 122 | .RE
|
|---|
| 123 | .PP
|
|---|
| 124 | NT\-Domain
|
|---|
| 125 | .RS 4
|
|---|
| 126 | The user\'s domain, expected to be in Samba\'s
|
|---|
| 127 | \m[blue]\fBunix charset\fR\m[]\&.
|
|---|
| 128 | .PP \fBExample\ \&3.\ \&\fR NT\-Domain: WORKGROUP
|
|---|
| 129 | .PP \fBExample\ \&4.\ \&\fR NT\-Domain:: V09SS0dST1VQ
|
|---|
| 130 | .RE
|
|---|
| 131 | .PP
|
|---|
| 132 | Full\-Username
|
|---|
| 133 | .RS 4
|
|---|
| 134 | The fully qualified username, expected to be in Samba\'s
|
|---|
| 135 | \m[blue]\fBunix charset\fR\m[]
|
|---|
| 136 | and qualified with the
|
|---|
| 137 | \m[blue]\fBwinbind separator\fR\m[]\&.
|
|---|
| 138 | .PP \fBExample\ \&5.\ \&\fR Full\-Username: WORKGROUP\ebob
|
|---|
| 139 | .PP \fBExample\ \&6.\ \&\fR Full\-Username:: V09SS0dST1VQYm9i
|
|---|
| 140 | .RE
|
|---|
| 141 | .PP
|
|---|
| 142 | LANMAN\-Challenge
|
|---|
| 143 | .RS 4
|
|---|
| 144 | The 8 byte
|
|---|
| 145 | LANMAN Challenge
|
|---|
| 146 | value, generated randomly by the server, or (in cases such as MSCHAPv2) generated in some way by both the server and the client\&.
|
|---|
| 147 | .PP \fBExample\ \&7.\ \&\fR LANMAN\-Challege: 0102030405060708
|
|---|
| 148 | .RE
|
|---|
| 149 | .PP
|
|---|
| 150 | LANMAN\-Response
|
|---|
| 151 | .RS 4
|
|---|
| 152 | The 24 byte
|
|---|
| 153 | LANMAN Response
|
|---|
| 154 | value, calculated from the user\'s password and the supplied
|
|---|
| 155 | LANMAN Challenge\&. Typically, this is provided over the network by a client wishing to authenticate\&.
|
|---|
| 156 | .PP \fBExample\ \&8.\ \&\fR LANMAN\-Response: 0102030405060708090A0B0C0D0E0F101112131415161718
|
|---|
| 157 | .RE
|
|---|
| 158 | .PP
|
|---|
| 159 | NT\-Response
|
|---|
| 160 | .RS 4
|
|---|
| 161 | The >= 24 byte
|
|---|
| 162 | NT Response
|
|---|
| 163 | calculated from the user\'s password and the supplied
|
|---|
| 164 | LANMAN Challenge\&. Typically, this is provided over the network by a client wishing to authenticate\&.
|
|---|
| 165 | .PP \fBExample\ \&9.\ \&\fR NT\-Response: 0102030405060708090A0B0C0D0E0F101112131415161718
|
|---|
| 166 | .RE
|
|---|
| 167 | .PP
|
|---|
| 168 | Password
|
|---|
| 169 | .RS 4
|
|---|
| 170 | The user\'s password\&. This would be provided by a network client, if the helper is being used in a legacy situation that exposes plaintext passwords in this way\&.
|
|---|
| 171 | .PP \fBExample\ \&10.\ \&\fR Password: samba2
|
|---|
| 172 | .PP \fBExample\ \&11.\ \&\fR Password:: c2FtYmEy
|
|---|
| 173 | .RE
|
|---|
| 174 | .PP
|
|---|
| 175 | Request\-User\-Session\-Key
|
|---|
| 176 | .RS 4
|
|---|
| 177 | Apon sucessful authenticaiton, return the user session key associated with the login\&.
|
|---|
| 178 | .PP \fBExample\ \&12.\ \&\fR Request\-User\-Session\-Key: Yes
|
|---|
| 179 | .RE
|
|---|
| 180 | .PP
|
|---|
| 181 | Request\-LanMan\-Session\-Key
|
|---|
| 182 | .RS 4
|
|---|
| 183 | Apon sucessful authenticaiton, return the LANMAN session key associated with the login\&.
|
|---|
| 184 | .PP \fBExample\ \&13.\ \&\fR Request\-LanMan\-Session\-Key: Yes
|
|---|
| 185 | .RE
|
|---|
| 186 | .if n \{\
|
|---|
| 187 | .sp
|
|---|
| 188 | .\}
|
|---|
| 189 | .RS 4
|
|---|
| 190 | .it 1 an-trap
|
|---|
| 191 | .nr an-no-space-flag 1
|
|---|
| 192 | .nr an-break-flag 1
|
|---|
| 193 | .br
|
|---|
| 194 | .ps +1
|
|---|
| 195 | \fBWarning\fR
|
|---|
| 196 | .ps -1
|
|---|
| 197 | .br
|
|---|
| 198 | Implementors should take care to base64 encode
|
|---|
| 199 | any data (such as usernames/passwords) that may contain malicous user data, such as
|
|---|
| 200 | a newline\&. They may also need to decode strings from
|
|---|
| 201 | the helper, which likewise may have been base64 encoded\&..sp .5v
|
|---|
| 202 | .RE
|
|---|
| 203 | .RE
|
|---|
| 204 | .RE
|
|---|
| 205 | .PP
|
|---|
| 206 | \-\-username=USERNAME
|
|---|
| 207 | .RS 4
|
|---|
| 208 | Specify username of user to authenticate
|
|---|
| 209 | .RE
|
|---|
| 210 | .PP
|
|---|
| 211 | \-\-domain=DOMAIN
|
|---|
| 212 | .RS 4
|
|---|
| 213 | Specify domain of user to authenticate
|
|---|
| 214 | .RE
|
|---|
| 215 | .PP
|
|---|
| 216 | \-\-workstation=WORKSTATION
|
|---|
| 217 | .RS 4
|
|---|
| 218 | Specify the workstation the user authenticated from
|
|---|
| 219 | .RE
|
|---|
| 220 | .PP
|
|---|
| 221 | \-\-challenge=STRING
|
|---|
| 222 | .RS 4
|
|---|
| 223 | NTLM challenge (in HEXADECIMAL)
|
|---|
| 224 | .RE
|
|---|
| 225 | .PP
|
|---|
| 226 | \-\-lm\-response=RESPONSE
|
|---|
| 227 | .RS 4
|
|---|
| 228 | LM Response to the challenge (in HEXADECIMAL)
|
|---|
| 229 | .RE
|
|---|
| 230 | .PP
|
|---|
|
|---|