1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="ntlm-auth.1">
6 <refentrytitle>ntlm_auth</refentrytitle>
7 <manvolnum>1</manvolnum>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">User Commands</refmiscinfo>
10 <refmiscinfo class="version">4.1</refmiscinfo>
15 <refname>ntlm_auth</refname>
16 <refpurpose>tool to allow external access to Winbind's NTLM authentication function</refpurpose>
21 <command>ntlm_auth</command>
22 <arg choice="opt">-d debuglevel</arg>
23 <arg choice="opt">-l logdir</arg>
24 <arg choice="opt">-s <smb config file></arg>
29 <title>DESCRIPTION</title>
31 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
32 <manvolnum>7</manvolnum></citerefentry> suite.</para>
34 <para><command>ntlm_auth</command> is a helper utility that authenticates
35 users using NT/LM authentication. It returns 0 if the users is authenticated
36 successfully and 1 if access was denied. ntlm_auth uses winbind to access
37 the user and authentication data for a domain. This utility
38 is only intended to be used by other programs (currently
39 <ulink url="http://www.squid-cache.org/">Squid</ulink>
40 and <ulink url="http://download.samba.org/ftp/unpacked/lorikeet/trunk/mod_ntlm_winbind/">mod_ntlm_winbind</ulink>)
45 <title>OPERATIONAL REQUIREMENTS</title>
48 The <citerefentry><refentrytitle>winbindd</refentrytitle>
49 <manvolnum>8</manvolnum></citerefentry> daemon must be operational
50 for many of these commands to function.</para>
52 <para>Some of these commands also require access to the directory
53 <filename>winbindd_privileged</filename> in
54 <filename>$LOCKDIR</filename>. This should be done either by running
55 this command as root or providing group access
56 to the <filename>winbindd_privileged</filename> directory. For
57 security reasons, this directory should not be world-accessable. </para>
63 <title>OPTIONS</title>
67 <term>--helper-protocol=PROTO</term>
69 Operate as a stdio-based helper. Valid helper protocols are:
73 <term>squid-2.4-basic</term>
75 Server-side helper for use with Squid 2.4's basic (plaintext)
76 authentication. </para>
80 <term>squid-2.5-basic</term>
82 Server-side helper for use with Squid 2.5's basic (plaintext)
83 authentication. </para>
87 <term>squid-2.5-ntlmssp</term>
89 Server-side helper for use with Squid 2.5's NTLMSSP
90 authentication. </para>
91 <para>Requires access to the directory
92 <filename>winbindd_privileged</filename> in
93 <filename>$LOCKDIR</filename>. The protocol used is
94 described here: <ulink
95 url="http://devel.squid-cache.org/ntlm/squid_helper_protocol.html">http://devel.squid-cache.org/ntlm/squid_helper_protocol.html</ulink>.
96 This protocol has been extended to allow the
97 NTLMSSP Negotiate packet to be included as an argument
98 to the <command>YR</command> command. (Thus avoiding
99 loss of information in the protocol exchange).
104 <term>ntlmssp-client-1</term>
106 Client-side helper for use with arbitrary external
107 programs that may wish to use Samba's NTLMSSP
108 authentication knowledge. </para>
109 <para>This helper is a client, and as such may be run by any
110 user. The protocol used is
111 effectively the reverse of the previous protocol. A
112 <command>YR</command> command (without any arguments)
113 starts the authentication exchange.
119 <term>gss-spnego</term>
121 Server-side helper that implements GSS-SPNEGO. This
122 uses a protocol that is almost the same as
123 <command>squid-2.5-ntlmssp</command>, but has some
124 subtle differences that are undocumented outside the
125 source at this stage.
127 <para>Requires access to the directory
128 <filename>winbindd_privileged</filename> in
129 <filename>$LOCKDIR</filename>.
135 <term>gss-spnego-client</term>
137 Client-side helper that implements GSS-SPNEGO. This
138 also uses a protocol similar to the above helpers, but
139 is currently undocumented.
145 <term>ntlm-server-1</term>
147 Server-side helper protocol, intended for use by a
148 RADIUS server or the 'winbind' plugin for pppd, for
149 the provision of MSCHAP and MSCHAPv2 authentication.
151 <para>This protocol consists of lines in the form:
152 <command>Parameter: value</command> and <command>Parameter::
153 Base64-encode value</command>. The presence of a single
154 period <command>.</command> indicates that one side has
155 finished supplying data to the other. (Which in turn
156 could cause the helper to authenticate the
159 <para>Currently implemented parameters from the
160 external program to the helper are:</para>
163 <term>Username</term>
164 <listitem><para>The username, expected to be in
165 Samba's <smbconfoption name="unix charset"/>.
168 <term>Examples:</term>
169 <para>Username: bob</para>
170 <para>Username:: Ym9i</para>
176 <term>NT-Domain</term>
177 <listitem><para>The user's domain, expected to be in
178 Samba's <smbconfoption name="unix charset"/>.
182 <term>Examples:</term>
183 <para>NT-Domain: WORKGROUP</para>
184 <para>NT-Domain:: V09SS0dST1VQ</para>
190 <term>Full-Username</term>
191 <listitem><para>The fully qualified username, expected to be
192 in Samba's <smbconfoption name="unix charset"/> and qualified
193 with the <smbconfoption name="winbind separator"/>.</para>
195 <term>Examples:</term>
196 <para>Full-Username: WORKGROUP\bob</para>
197 <para>Full-Username:: V09SS0dST1VQYm9i</para>
203 <term>LANMAN-Challenge</term>
204 <listitem><para>The 8 byte <command>LANMAN Challenge</command>
205 value, generated randomly by the server, or (in cases such
206 as MSCHAPv2) generated in some way by both the server and
209 <term>Examples:</term>
210 <para>LANMAN-Challenge: 0102030405060708</para>
216 <term>LANMAN-Response</term>
217 <listitem><para>The 24 byte <command>LANMAN Response</command> value,
218 calculated from the user's password and the supplied
219 <command>LANMAN Challenge</command>. Typically, this
220 is provided over the network by a client wishing to authenticate.
223 <term>Examples:</term>
224 <para>LANMAN-Response: 0102030405060708090A0B0C0D0E0F101112131415161718</para>
230 <term>NT-Response</term>
231 <listitem><para>The >= 24 byte <command>NT Response</command>
232 calculated from the user's password and the supplied
233 <command>LANMAN Challenge</command>. Typically, this is
234 provided over the network by a client wishing to authenticate.
237 <term>Examples:</term>
238 <para>NT-Response: 0102030405060708090A0B0C0D0E0F10111213141516171</para>
244 <term>Password</term>
245 <listitem><para>The user's password. This would be
246 provided by a network client, if the helper is being
247 used in a legacy situation that exposes plaintext
248 passwords in this way.</para>
250 <term>Examples:</term>
251 <para>Password: samba2</para>
252 <para>Password:: c2FtYmEy</para>
258 <term>Request-User-Session-Key</term>
259 <listitem><para>Upon successful authenticaiton, return
260 the user session key associated with the login.</para>
262 <term>Examples:</term>
263 <para>Request-User-Session-Key: Yes</para>
269 <term>Request-LanMan-Session-Key</term>
270 <listitem><para>Upon successful authenticaiton, return
271 the LANMAN session key associated with the login.
274 <term>Examples:</term>
275 <para>Request-LanMan-Session-Key: Yes</para>
284 <warning><para>Implementers should take care to base64 encode
285 any data (such as usernames/passwords) that may contain malicous user data, such as
286 a newline. They may also need to decode strings from
287 the helper, which likewise may have been base64 encoded.</para></warning>
292 <term>--username=USERNAME</term>
294 Specify username of user to authenticate
300 <term>--domain=DOMAIN</term>
302 Specify domain of user to authenticate
307 <term>--workstation=WORKSTATION</term>
309 Specify the workstation the user authenticated from
314 <term>--challenge=STRING</term>
315 <listitem><para>NTLM challenge (in HEXADECIMAL)</para>
320 <term>--lm-response=RESPONSE</term>
321 <listitem><para>LM Response to the challenge (in HEXADECIMAL)</para></listitem>
325 <term>--nt-response=RESPONSE</term>
326 <listitem><para>NT or NTLMv2 Response to the challenge (in HEXADECIMAL)</para></listitem>
330 <term>--password=PASSWORD</term>
331 <listitem><para>User's plaintext password</para><para>If
332 not specified on the command line, this is prompted for when
335 <para>For the NTLMSSP based server roles, this parameter
336 specifies the expected password, allowing testing without
337 winbindd operational.</para>
342 <term>--request-lm-key</term>
343 <listitem><para>Retrieve LM session key</para></listitem>
347 <term>--request-nt-key</term>
348 <listitem><para>Request NT key</para></listitem>
352 <term>--diagnostics</term>
353 <listitem><para>Perform Diagnostics on the authentication
354 chain. Uses the password from <command>--password</command>
355 or prompts for one.</para>
360 <term>--require-membership-of={SID|Name}</term>
361 <listitem><para>Require that a user be a member of specified
362 group (either name or SID) for authentication to succeed.</para>
366 &stdarg.server.debug;
374 <title>EXAMPLE SETUP</title>
376 <para>To setup ntlm_auth for use by squid 2.5, with both basic and
377 NTLMSSP authentication, the following
378 should be placed in the <filename>squid.conf</filename> file.
380 auth_param ntlm program ntlm_auth --helper-protocol=squid-2.5-ntlmssp
381 auth_param basic program ntlm_auth --helper-protocol=squid-2.5-basic
382 auth_param basic children 5
383 auth_param basic realm Squid proxy-caching web server
384 auth_param basic credentialsttl 2 hours
385 </programlisting></para>
387 <note><para>This example assumes that ntlm_auth has been installed into your
388 path, and that the group permissions on
389 <filename>winbindd_privileged</filename> are as described above.</para></note>
391 <para>To setup ntlm_auth for use by squid 2.5 with group limitation in addition to the above
392 example, the following should be added to the <filename>squid.conf</filename> file.
394 auth_param ntlm program ntlm_auth --helper-protocol=squid-2.5-ntlmssp --require-membership-of='WORKGROUP\Domain Users'
395 auth_param basic program ntlm_auth --helper-protocol=squid-2.5-basic --require-membership-of='WORKGROUP\Domain Users'
396 </programlisting></para>
401 <title>TROUBLESHOOTING</title>
403 <para>If you're experiencing problems with authenticating Internet Explorer running
404 under MS Windows 9X or Millennium Edition against ntlm_auth's NTLMSSP authentication
405 helper (--helper-protocol=squid-2.5-ntlmssp), then please read
406 <ulink url="http://support.microsoft.com/support/kb/articles/Q239/8/69.ASP">
407 the Microsoft Knowledge Base article #239869 and follow instructions described there</ulink>.
412 <title>VERSION</title>
414 <para>This man page is correct for version 3 of the Samba
419 <title>AUTHOR</title>
421 <para>The original Samba software and related utilities
422 were created by Andrew Tridgell. Samba is now developed
423 by the Samba Team as an Open Source project similar
424 to the way the Linux kernel is developed.</para>
426 <para>The ntlm_auth manpage was written by Jelmer Vernooij and
427 Andrew Bartlett.</para>