File: kerberos.htm

package info (click to toggle)
lprng 3.8.10-1.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 13,076 kB
  • ctags: 4,348
  • sloc: ansic: 35,394; sh: 10,756; perl: 2,210; makefile: 1,046
file content (439 lines) | stat: -rw-r--r-- 15,472 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta name="generator" content="HTML Tidy, see www.w3.org">
    <title>Using Kerberos 5 for Authentication</title>
    <meta name="GENERATOR" content=
    "Modular DocBook HTML Stylesheet Version 1.71 ">
    <link rel="HOME" title=" LPRng-HOWTO" href="index.htm">
    <link rel="UP" title="Permissions and Authentication " href=
    "permsref.htm">
    <link rel="PREVIOUS" title="PGP Authentication Support" href=
    "x8993.htm">
    <link rel="NEXT" title="Using Kerberos 4 for Authentication"
    href="x9264.htm">
  </head>

  <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link=
  "#0000FF" vlink="#840084" alink="#0000FF">
    <div class="NAVHEADER">
      <table summary="Header navigation table" width="100%" border=
      "0" cellpadding="0" cellspacing="0">
        <tr>
          <th colspan="3" align="center">LPRng-HOWTO: 1 Apr 2002
          (For LPRng-3.8.10)</th>
        </tr>

        <tr>
          <td width="10%" align="left" valign="bottom"><a href=
          "x8993.htm" accesskey="P">Prev</a></td>

          <td width="80%" align="center" valign="bottom">Chapter
          17. Permissions and Authentication</td>

          <td width="10%" align="right" valign="bottom"><a href=
          "x9264.htm" accesskey="N">Next</a></td>
        </tr>
      </table>
      <hr align="LEFT" width="100%">
    </div>

    <div class="SECT1">
      <h1 class="SECT1"><a name="KERBEROS">17.14. Using Kerberos 5
      for Authentication</a></h1>

      <p><b class="APPLICATION">LPRng</b> Kerberos 5 authentication
      is based on the Kerberos5-1.2.4 release as of 3 March 2020.
      The distribution was obtained from MIT from the <i class=
      "EMPHASIS"><a href="http://web.mit.edu/kerberos/www/" target=
      "_top">http://web.mit.edu/kerberos/www/</a></i> Website.</p>

      <p>The following sections briefly describes how to set up and
      test the Kerberos software and then how to configure <b
      class="APPLICATION">LPRng</b> to use Kerberos.</p>

      <div class="SECT2">
        <h2 class="SECT2"><a name="AEN9124">17.14.1. <b class=
        "APPLICATION">LPRng</b> Configuration</a></h2>

        <p>The following <tt class="LITERAL">configure</tt> options
        are used to enable Kerberos support:</p>

        <div class="INFORMALEXAMPLE">
          <a name="AEN9129"></a>
<pre class="SCREEN">
    --enable-kerberos         enable Kerberos V support
    --enable-mit_kerberos4    enable MIT Kerberos 4 support
    --disable-kerberos_checks disable Kerberos sanity checks
</pre>
        </div>
        <br>
        <br>

        <p>The <tt class="LITERAL">--enable-kerberos</tt> option
        will cause <tt class="LITERAL">configure</tt> to search for
        the include files such as <tt class="FILENAME">krb5.h</tt>
        and the <tt class="LITERAL">krb5</tt> support libraries.
        libraries. If it finds these, then Kerberos authentication
        will be included. The <tt class=
        "LITERAL">--enable-mit_kerberos</tt> enable searching for
        the Kerberos 4 include files and support libraries. If
        these are found then MIT Kerberos 4 compatibility will be
        enabled. The <tt class=
        "LITERAL">--disable-kerberos_checks</tt> will disable
        checking for libraries and simply enable the various
        options.</p>
      </div>

      <div class="SECT2">
        <h2 class="SECT2"><a name="AEN9138">17.14.2. Kerberos
        Installation Procedure</a></h2>

        <ol type="1">
          <li>
            <p>Get the Kerberos 5 distribution.</p>
          </li>

          <li>
            <p>Compile and install the distribution.</p>
          </li>

          <li>
            <p>Create the <tt class="FILENAME">/etc/krb5.conf</tt>
            and <tt class=
            "FILENAME">/usr/local/var/krb5kdc/kdc.conf</tt>, files
            using templates from the files in the Kerberos
            distribution's <tt class=
            "FILENAME">src/config-files</tt> directory. See the
            Kerberos Installation Guide and the Kerberos System
            Administrators Guide for details.</p>
          </li>

          <li>
            <p>Start up the KDC and KADMIN servers - you might want
            to put the following in your <tt class=
            "FILENAME">rc.local</tt> or equivalent system startup
            files:</p>

            <div class="INFORMALEXAMPLE">
              <a name="AEN9154"></a>
<pre class="SCREEN">
    if [ -f /etc/krb5.conf -a -f /usr/local/var/krb5kdc/kdc.conf  ]; then
        echo -n ' krb5kdc ';    /usr/local/sbin/krb5kdc;
        echo -n ' kadmind ';    /usr/local/sbin/kadmind;
    fi
</pre>
            </div>
            <br>
            <br>
          </li>

          <li>
            <p>Use kadmin (or kadmin.local) to create principals
            for your users.</p>
          </li>

          <li>
            <p>Use kadmin (or kadmin.local) to create principals
            for the <b class="APPLICATION">lpd</b> servers. The
            recommended method is to use <tt class=
            "FILENAME">lpr/hostname@REALM</tt> as a template for
            the principal name, i.e. - <tt class=
            "LITERAL">lpr/astart1.private@ASTART.COM</tt> for an
            example. You should use fully qualified domain names
            for the principals. Do not assign the principal a
            password.</p>

            <div class="INFORMALEXAMPLE">
              <a name="AEN9163"></a>
<pre class="SCREEN">
    Example:
    
    #&gt; kadmin   OR #&gt; kadmin.local 
    kadmin: addprinc -randkey lpr/wayoff.private@ASTART.COM
    quit
</pre>
            </div>
            <br>
            <br>
          </li>

          <li>
            <p>Extract the keytab for each server:</p>

            <div class="INFORMALEXAMPLE">
              <a name="AEN9167"></a>
<pre class="SCREEN">
    Example:
    #&gt; kadmin   OR #&gt; kadmin.local 
    ktadd -k /etc/lpr.wayoff.private  lpr/wayoff.private@ASTART.COM
    quit
</pre>
            </div>
            <br>
            <br>
          </li>

          <li>
            <p>The <tt class="LITERAL">/etc/lpr.wayoff.private</tt>
            file contains the keytab information which is the
            equivalent of a password for a server program. You
            should create these files and then copy the appropriate
            <tt class="LITERAL">keytab</tt> file to <tt class=
            "FILENAME">/etc/lpd.keytab</tt> file on each server.
            See the warnings about of keytab files in the Kerberos
            Installation and Kerberos Administration manuals. You
            should copy the file using an encrypted connection, set
            the permissions to read only by the owner (<tt class=
            "LITERAL">400</tt>), and set the owner to <tt class=
            "LITERAL">daemon</tt> or the user that <b class=
            "APPLICATION">lpd</b> will run as.</p>

            <div class="INFORMALEXAMPLE">
              <a name="AEN9177"></a>
<pre class="SCREEN">
    #&gt; chmod 400 lpr.wayoff.com
    #&gt; scp lpr.wayoff.com root@wayoff.com:/etc/lpd.keytab
    #&gt; ssh -l root wayoff.com
    # wayoff &gt; chmod 400 /etc/lpd.keytab  
    # wayoff &gt; chown daemon /etc/lpd.keytab  
    # wayoff &gt; ls -l /etc/lpd.keytab  
    -rw-------  1 daemon  wheel  128 Jan 16 11:06 /etc/lpd.keytab
</pre>
            </div>
            <br>
            <br>
          </li>

          <li>
            <p>If you want to have MIT Kerberos4 printing
            compatibility then you will need to set up Kerberos 4
            <tt class="LITERAL">servertabs</tt> instead of Kerberos
            5 keytabs. Assuming that you have put the Kerberos 5
            keytab in <tt class="FILENAME">/etc/lpd.keytab</tt>,
            then you extract the Kerberos 4 srvtab version of the
            Kerberos 5 keytab using the following commands. You
            must put the key in the <tt class=
            "FILENAME">/etc/srvtab</tt> file in order to be
            compatible with the Kerberos 4 support.</p>

            <div class="INFORMALEXAMPLE">
              <a name="AEN9184"></a>
<pre class="SCREEN">
    <tt class="PROMPT">h4: {321} #</tt> <tt class=
"USERINPUT"><b>ktuil</b></tt>
    <tt class="USERINPUT"><b>rkt /etc/lpd.keytab</b></tt>
    <tt class="USERINPUT"><b>wst /etc/srvtab</b></tt>
</pre>
            </div>
            <br>
            <br>
          </li>
        </ol>
        <br>
        <br>
      </div>

      <div class="SECT2">
        <h2 class="SECT2"><a name="AEN9190">17.14.3. <b class=
        "APPLICATION">LPRng</b> Configuration</a></h2>

        <p>The <b class="APPLICATION">LPRng</b> software needs to
        be configured so that it can find the Kerberos libraries
        and include files. By default, the include files are
        installed in <tt class="FILENAME">/usr/local/include</tt>
        and the libraries in <tt class=
        "FILENAME">/usr/local/lib</tt>. Use the following steps to
        configure <b class="APPLICATION">LPRng</b> so that it uses
        these directories during configuration and
        installation:</p>

        <div class="INFORMALEXAMPLE">
          <a name="AEN9198"></a>
<pre class="SCREEN">
    cd .../LPRng
    rm -f config.cache
    CPPFLAGS="-I/usr/local/include -I/usr/include/kerberosIV" \
      LDFLAGS="-L/usr/local/lib -L/usr/lib/kerberosIV" \
      ./configure
    make clean all
    su
    make install
</pre>
        </div>
        <br>
        <br>
      </div>

      <div class="SECT2">
        <h2 class="SECT2"><a name="AEN9200">17.14.4. Printcap
        Entries</a></h2>

        <p>Options used:</p>

        <ul>
          <li>
            <p><tt class="LITERAL">auth=kerberos5</tt><i class=
            "EMPHASIS">use Kerberos5 authentication</i></p>
          </li>

          <li>
            <p><tt class="LITERAL">kerberos_id=</tt><i class=
            "EMPHASIS">server prinicpal name (for client
            use)</i></p>
          </li>

          <li>
            <p><tt class=
            "LITERAL">kerberos_server_principal=</tt><i class=
            "EMPHASIS">alias for kerberos_id</i></p>
          </li>

          <li>
            <p><tt class="LITERAL">kerberos_forward_id=</tt><i
            class="EMPHASIS">destination server used by
            server</i></p>
          </li>

          <li>
            <p><tt class=
            "LITERAL">kerberos_forward_principal=</tt><i class=
            "EMPHASIS">alias for kerberos_forward_id</i></p>
          </li>

          <li>
            <p><tt class="LITERAL">kerberos_keytab=</tt><i class=
            "EMPHASIS">location of the lpd server keytab
            file</i></p>
          </li>

          <li>
            <p><tt class="LITERAL">kerberos_service=</tt><i class=
            "EMPHASIS">service to be used</i></p>
          </li>

          <li>
            <p><tt class="LITERAL">kerberos_life=</tt><i class=
            "EMPHASIS">lpd server ticket lifetime</i></p>
          </li>

          <li>
            <p><tt class="LITERAL">kerberos_renew=</tt><i class=
            "EMPHASIS">lpd server ticket renew</i></p>
          </li>
        </ul>
        <br>
        <br>

        <p>Example printcap entry:</p>

        <div class="INFORMALEXAMPLE">
          <a name="AEN9241"></a>
<pre class="SCREEN">
    pr:client
        :lp=pr@wayoff
        :auth=kerberos5
        :kerberos_id=lpr/wayoff.private@ASTART.COM
    pr:server
        :lp=pr@faroff.private
        :auth_forward=kerberos5
        :kerberos_id=lpr/wayoff.private@ASTART.COM
        :kerberos_forward_id=lpr/faroff.private@ASTART.COM
        :kerberos_keytab=/etc/lpd.keytab
    
    OR If you want to use Kerberos 4 authentication to the server
    pr:client
        :lp=pr@wayoff
        :auth=kerberos4
        :kerberos_id=lpr/wayoff.private@ASTART.COM
    # support both Kerberos 4 and 5 on server
    pr:server
        :lp=pr@faroff.private
        :auth_forward=kerberos5
        :kerberos_id=lpr/wayoff.private@ASTART.COM
        :kerberos_forward_id=lpr/faroff.private@ASTART.COM
        :kerberos_keytab=/etc/lpd.keytab
</pre>
        </div>
        <br>
        <br>

        <p>The printcap configuration for Kerberos authentication
        is very simple.</p>

        <p>The <tt class="LITERAL">kerberos_id</tt> is the
        principal name of the lpd server that clients will connect
        to. For backwards compatibility, <tt class=
        "LITERAL">kerberos_server_principal</tt> can also be used.
        This values is used to obtain a ticket for the <b class=
        "APPLICATION">lpd</b> server, and is the only entry
        required for client to server authentication.</p>

        <p>The other entries are used by the <b class=
        "APPLICATION">lpd</b> server. <tt class=
        "LITERAL">kerberos_keytab</tt> entry is the location of the
        keytab file to be used by the server. This contains the
        passphrase used by the server to authenticate itself and
        get a ticket from the ticket server.</p>

        <p>The <tt class="LITERAL">kerberos_id</tt> value is also
        used by the server during the authentication process to
        make sure that the correct principal name was used by the
        request originator. This check has saved many hours of pain
        in trying to determine why authentication is failing.</p>

        <p>The <tt class="LITERAL">kerberos_life</tt> and <tt
        class="LITERAL">kerberos_renew</tt> set the lifetime and
        renewability of the lpd server Kerberos tickets. These
        values should not be modified unless you are familiar with
        the Kerberos system. There are extensive notes in the <b
        class="APPLICATION">LPRng</b> source code concerning these
        values. The <tt class="LITERAL">kerberos_service</tt> value
        supplies the name of the service to be used when generating
        a ticket. It is stronly recommended that the <tt class=
        "LITERAL">kerberos_id</tt> entry be used instead.</p>
      </div>

      <div class="SECT2">
        <h2 class="SECT2"><a name="AEN9259">17.14.5. User
        Environment Variables and Files</a></h2>

        <p>In order to use kerberos authentication, the user will
        need to obtain a ticket from the Kerberos ticket server.
        This is done using <tt class="LITERAL">kinit</tt>.</p>

        <p>No other actions are required by the user.</p>
      </div>
    </div>

    <div class="NAVFOOTER">
      <hr align="LEFT" width="100%">

      <table summary="Footer navigation table" width="100%" border=
      "0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="33%" align="left" valign="top"><a href=
          "x8993.htm" accesskey="P">Prev</a></td>

          <td width="34%" align="center" valign="top"><a href=
          "index.htm" accesskey="H">Home</a></td>

          <td width="33%" align="right" valign="top"><a href=
          "x9264.htm" accesskey="N">Next</a></td>
        </tr>

        <tr>
          <td width="33%" align="left" valign="top">PGP
          Authentication Support</td>

          <td width="34%" align="center" valign="top"><a href=
          "permsref.htm" accesskey="U">Up</a></td>

          <td width="33%" align="right" valign="top">Using Kerberos
          4 for Authentication</td>
        </tr>
      </table>
    </div>
  </body>
</html>