1NTLM_AUTH(1)                     User Commands                    NTLM_AUTH(1)
2
3
4

NAME

6       ntlm_auth - tool to allow external access to Winbind's NTLM
7       authentication function
8

SYNOPSIS

10       ntlm_auth [-d debuglevel] [-l logdir] [-s <smb config file>]
11

DESCRIPTION

13       This tool is part of the samba(7) suite.
14
15       ntlm_auth is a helper utility that authenticates users using NT/LM
16       authentication. It returns 0 if the users is authenticated successfully
17       and 1 if access was denied. ntlm_auth uses winbind to access the user
18       and authentication data for a domain. This utility is only intended to
19       be used by other programs (currently Squid and mod_ntlm_winbind)
20

OPERATIONAL REQUIREMENTS

22       The winbindd(8) daemon must be operational for many of these commands
23       to function.
24
25       Some of these commands also require access to the directory
26       winbindd_privileged in $LOCKDIR. This should be done either by running
27       this command as root or providing group access to the
28       winbindd_privileged directory. For security reasons, this directory
29       should not be world-accessable.
30

OPTIONS

32       --helper-protocol=PROTO
33           Operate as a stdio-based helper. Valid helper protocols are:
34
35           squid-2.4-basic
36               Server-side helper for use with Squid 2.4's basic (plaintext)
37               authentication.
38
39           squid-2.5-basic
40               Server-side helper for use with Squid 2.5's basic (plaintext)
41               authentication.
42
43           squid-2.5-ntlmssp
44               Server-side helper for use with Squid 2.5's NTLMSSP
45               authentication.
46
47               Requires access to the directory winbindd_privileged in
48               $LOCKDIR. The protocol used is described here:
49               http://devel.squid-cache.org/ntlm/squid_helper_protocol.html.
50               This protocol has been extended to allow the NTLMSSP Negotiate
51               packet to be included as an argument to the YR command. (Thus
52               avoiding loss of information in the protocol exchange).
53
54           ntlmssp-client-1
55               Client-side helper for use with arbitrary external programs
56               that may wish to use Samba's NTLMSSP authentication knowledge.
57
58               This helper is a client, and as such may be run by any user.
59               The protocol used is effectively the reverse of the previous
60               protocol. A YR command (without any arguments) starts the
61               authentication exchange.
62
63           gss-spnego
64               Server-side helper that implements GSS-SPNEGO. This uses a
65               protocol that is almost the same as squid-2.5-ntlmssp, but has
66               some subtle differences that are undocumented outside the
67               source at this stage.
68
69               Requires access to the directory winbindd_privileged in
70               $LOCKDIR.
71
72           gss-spnego-client
73               Client-side helper that implements GSS-SPNEGO. This also uses a
74               protocol similar to the above helpers, but is currently
75               undocumented.
76
77           ntlm-server-1
78               Server-side helper protocol, intended for use by a RADIUS
79               server or the 'winbind' plugin for pppd, for the provision of
80               MSCHAP and MSCHAPv2 authentication.
81
82               This protocol consists of lines in the form: Parameter: value
83               and Parameter:: Base64-encode value. The presence of a single
84               period .  indicates that one side has finished supplying data
85               to the other. (Which in turn could cause the helper to
86               authenticate the user).
87
88               Currently implemented parameters from the external program to
89               the helper are:
90
91               Username
92                   The username, expected to be in Samba's unix charset.
93
94                   Examples:
95                       Username: bob
96
97                       Username:: Ym9i
98
99               NT-Domain
100                   The user's domain, expected to be in Samba's unix charset.
101
102                   Examples:
103                       NT-Domain: WORKGROUP
104
105                       NT-Domain:: V09SS0dST1VQ
106
107               Full-Username
108                   The fully qualified username, expected to be in Samba's
109                   unix charset and qualified with the winbind separator.
110
111                   Examples:
112                       Full-Username: WORKGROUP\bob
113
114                       Full-Username:: V09SS0dST1VQYm9i
115
116               LANMAN-Challenge
117                   The 8 byte LANMAN Challenge value, generated randomly by
118                   the server, or (in cases such as MSCHAPv2) generated in
119                   some way by both the server and the client.
120
121                   Examples:
122                       LANMAN-Challenge: 0102030405060708
123
124               LANMAN-Response
125                   The 24 byte LANMAN Response value, calculated from the
126                   user's password and the supplied LANMAN Challenge.
127                   Typically, this is provided over the network by a client
128                   wishing to authenticate.
129
130                   Examples:
131                       LANMAN-Response:
132                       0102030405060708090A0B0C0D0E0F101112131415161718
133
134               NT-Response
135                   The >= 24 byte NT Response calculated from the user's
136                   password and the supplied LANMAN Challenge. Typically, this
137                   is provided over the network by a client wishing to
138                   authenticate.
139
140                   Examples:
141                       NT-Response:
142                       0102030405060708090A0B0C0D0E0F10111213141516171
143
144               Password
145                   The user's password. This would be provided by a network
146                   client, if the helper is being used in a legacy situation
147                   that exposes plaintext passwords in this way.
148
149                   Examples:
150                       Password: samba2
151
152                       Password:: c2FtYmEy
153
154               Request-User-Session-Key
155                   Upon successful authenticaiton, return the user session key
156                   associated with the login.
157
158                   Examples:
159                       Request-User-Session-Key: Yes
160
161               Request-LanMan-Session-Key
162                   Upon successful authenticaiton, return the LANMAN session
163                   key associated with the login.
164
165                   Examples:
166                       Request-LanMan-Session-Key: Yes
167
168
169               Warning
170               Implementers should take care to base64 encode any data (such
171               as usernames/passwords) that may contain malicous user data,
172               such as a newline. They may also need to decode strings from
173               the helper, which likewise may have been base64 encoded.
174
175       --username=USERNAME
176           Specify username of user to authenticate
177
178       --domain=DOMAIN
179           Specify domain of user to authenticate
180
181       --workstation=WORKSTATION
182           Specify the workstation the user authenticated from
183
184       --challenge=STRING
185           NTLM challenge (in HEXADECIMAL)
186
187       --lm-response=RESPONSE
188           LM Response to the challenge (in HEXADECIMAL)
189
190       --nt-response=RESPONSE
191           NT or NTLMv2 Response to the challenge (in HEXADECIMAL)
192
193       --password=PASSWORD
194           User's plaintext password
195
196           If not specified on the command line, this is prompted for when
197           required.
198
199           For the NTLMSSP based server roles, this parameter specifies the
200           expected password, allowing testing without winbindd operational.
201
202       --request-lm-key
203           Retrieve LM session key
204
205       --request-nt-key
206           Request NT key
207
208       --diagnostics
209           Perform Diagnostics on the authentication chain. Uses the password
210           from --password or prompts for one.
211
212       --require-membership-of={SID|Name}
213           Require that a user be a member of specified group (either name or
214           SID) for authentication to succeed.
215
216       -d|--debuglevel=level
217           level is an integer from 0 to 10. The default value if this
218           parameter is not specified is 0.
219
220           The higher this value, the more detail will be logged to the log
221           files about the activities of the server. At level 0, only critical
222           errors and serious warnings will be logged. Level 1 is a reasonable
223           level for day-to-day running - it generates a small amount of
224           information about operations carried out.
225
226           Levels above 1 will generate considerable amounts of log data, and
227           should only be used when investigating a problem. Levels above 3
228           are designed for use only by developers and generate HUGE amounts
229           of log data, most of which is extremely cryptic.
230
231           Note that specifying this parameter here will override the log
232           level parameter in the smb.conf file.
233
234       -V|--version
235           Prints the program version number.
236
237       -s|--configfile <configuration file>
238           The file specified contains the configuration details required by
239           the server. The information in this file includes server-specific
240           information such as what printcap file to use, as well as
241           descriptions of all the services that the server is to provide. See
242           smb.conf for more information. The default configuration file name
243           is determined at compile time.
244
245       -l|--log-basename=logdirectory
246           Base directory name for log/debug files. The extension ".progname"
247           will be appended (e.g. log.smbclient, log.smbd, etc...). The log
248           file is never removed by the client.
249
250       -?|--help
251           Print a summary of command line options.
252

EXAMPLE SETUP

254       To setup ntlm_auth for use by squid 2.5, with both basic and NTLMSSP
255       authentication, the following should be placed in the squid.conf file.
256
257           auth_param ntlm program ntlm_auth --helper-protocol=squid-2.5-ntlmssp
258           auth_param basic program ntlm_auth --helper-protocol=squid-2.5-basic
259           auth_param basic children 5
260           auth_param basic realm Squid proxy-caching web server
261           auth_param basic credentialsttl 2 hours
262
263           Note
264           This example assumes that ntlm_auth has been installed into your
265           path, and that the group permissions on winbindd_privileged are as
266           described above.
267
268       To setup ntlm_auth for use by squid 2.5 with group limitation in
269       addition to the above example, the following should be added to the
270       squid.conf file.
271
272           auth_param ntlm program ntlm_auth --helper-protocol=squid-2.5-ntlmssp --require-membership-of='WORKGROUP\Domain Users'
273           auth_param basic program ntlm_auth --helper-protocol=squid-2.5-basic --require-membership-of='WORKGROUP\Domain Users'
274

TROUBLESHOOTING

276       If you're experiencing problems with authenticating Internet Explorer
277       running under MS Windows 9X or Millennium Edition against ntlm_auth's
278       NTLMSSP authentication helper (--helper-protocol=squid-2.5-ntlmssp),
279       then please read the Microsoft Knowledge Base article #239869 and
280       follow instructions described there.
281

VERSION

283       This man page is correct for version 3 of the Samba suite.
284

AUTHOR

286       The original Samba software and related utilities were created by
287       Andrew Tridgell. Samba is now developed by the Samba Team as an Open
288       Source project similar to the way the Linux kernel is developed.
289
290       The ntlm_auth manpage was written by Jelmer Vernooij and Andrew
291       Bartlett.
292
293
294
295Samba 3.6                         04/11/2016                      NTLM_AUTH(1)
Impressum