kerberos-and-apache2-single-sign-on

JSON

rev 5  |  foxhop  |  1346238796000  |  JSON

rev 4
rev 5
98====================================================98====================================================
9999
n100Copy keytab and adjust perms::n100Copy keytab and adjust perms
101 
102.. code-block:: bash
101103
102 cd /etc/httpd104 cd /etc/httpd
105 chmod 640 testweb.foxhop.net.keytab107 chmod 640 testweb.foxhop.net.keytab
106 108 
n107Test keytab::n109Test keytab
110 
111.. code-block:: bash
108 112 
109 # you should see a ticket113 # you should see a ticket
111 klist115 klist
112116
n113Install custom mod_auth_kerb RPM::n117Install custom mod_auth_kerb RPM
118 
119.. code-block:: bash
114120
115 rpm -Uvh /usr/local/src/mod_auth_kerb-5.4-0.x86_64.rpm121 rpm -Uvh /usr/local/src/mod_auth_kerb-5.4-0.x86_64.rpm
116 122 
n117Configure Apache2 VirtualHost::n123Configure Apache2 VirtualHost
118124
nn125 
119 vi /etc/httpd/conf.d/000-testweb.foxhop.net.conf::126vi /etc/httpd/conf.d/000-testweb.foxhop.net.conf
120 127 
128.. code-block:: apache
129   #... 
130 
121  ##################131  ##################
122  #    Kerberos    #132  #    Kerberos    #
132    # Compiled custom RPM: /usr/local/src/mod_auth_kerb-5.4-0.x86_64.rpm142    # Compiled custom RPM: /usr/local/src/mod_auth_kerb-5.4-0.x86_64.rpm
133    KrbLocalUserMapping on143    KrbLocalUserMapping on
tt144 
145    #...
146 
rev 4  |  foxhop  |  1346238647000  |  JSON

rev 3
rev 4
68====================================68====================================
69 69 
n70Get a ticket and authenticate your user::n70Get a ticket and authenticate your user
71 
72.. code-block:: cli
71 73 
72 kinit foxhop-test@AD.FOXHOP.NET74 kinit foxhop-test@AD.FOXHOP.NET
74   Password for foxhop@AD.FOXHOP.NET:76   Password for foxhop@AD.FOXHOP.NET:
75   77   
n76View the ticket::n78View the ticket
79 
80.. code-block:: cli
77   81   
78 klist82 klist
82        renew until 08/02/12 11:07:2286        renew until 08/02/12 11:07:22
8387
t84Delete or destroy all tickets::t88Delete or destroy all tickets
89 
90.. code-block:: cli
85        91        
86 kdestroy92 kdestroy
rev 3  |  foxhop  |  1346238521000  |  JSON

rev 2
rev 3
28===================================================28===================================================
2929
t30vim /etc/krb5.conf::t30vim /etc/krb5.conf
31 
32.. code-block:: ini
31 33 
32 [logging]34 [logging]
rev 2  |  foxhop  |  1346238427000  |  JSON

rev 1
rev 2
15#. generate a keytab file15#. generate a keytab file
1616
t17 ::t17 .. code-block:: txt
18 18 
19  # run on srv010319  # run on srv0103
rev 1  |  foxhop  |  1346238220000  |  JSON

empty
rev 1
tt1Kerberos and Apache2 Single-Sign-on
2###########################################
3 
4**Record of steps taken when building testweb.foxhop.net**
5 
6.. contents::
7 
8Prepare Service AD account and keytab
9===================================================
10 
11Windows Domain admin required. 
12 
13#. configure the testservice AD user account
14#. configure the testservice AD user password to sup3rs3cur3
15#. generate a keytab file
16 
17 ::
18 
19  # run on srv0103
20  ktpass -out c:\temp\testweb.foxhop.net.keytab ^
21   -princ HTTP/testweb.foxhop.net@AD.FOXHOP.NET ^
22   -mapUser testservice@AD.FOXHOP.NET -mapOp set -pass sup3rs3cur3 ^
23   -crypto RC4-HMAC-NT -pType KRB5_NT_PRINCIPAL
24 
25Copy keytab to /tmp on linux webserver.
26 
27Configure Kerberos
28===================================================
29 
30vim /etc/krb5.conf::
31 
32 [logging]
33 default = FILE:/var/log/krb5libs.log
34 kdc = FILE:/var/log/krb5kdc.log
35 admin_server = FILE:/var/log/kadmind.log
36 
37 [libdefaults]
38 default_realm = AD.FOXHOP.NET
39 dns_lookup_realm = true
40 dns_lookup_kdc = true
41 ticket_lifetime = 24h
42 forwardable = yes
43 
44 [realms]
45 AD.FOXHOP.NET = {
46  kdc = DS1.AD.FOXHOP.NET
47  kdc = DS2.AD.FOXHOP.NET
48  admin_server = DS1.AD.FOXHOP.NET
49  default_domain = AD.FOXHOP.NET
50 }
51 
52 [domain_realm]
53  .ad.foxhop.net = AD.FOXHOP.NET
54  ad.foxhop.net = AD.FOXHOP.NET
55 
56 [appdefaults]
57 pam = {
58   debug = false
59   ticket_lifetime = 36000
60   renew_lifetime = 36000
61   forwardable = true
62   krb4_convert = false
63 }
64 
65Test Kerberos
66====================================
67 
68Get a ticket and authenticate your user::
69 
70 kinit foxhop-test@AD.FOXHOP.NET
71 
72   Password for foxhop@AD.FOXHOP.NET:
73   
74View the ticket::
75   
76 klist
77 
78   Valid starting     Expires            Service principal
79   08/01/12 11:07:22  08/01/12 21:07:27  krbtgt/AD.FOXHOP.NET@AD.FOXHOP.NET
80        renew until 08/02/12 11:07:22
81 
82Delete or destroy all tickets::
83        
84 kdestroy
85 klist
86 
87Successfully configured kerberos
88 
89Configure Apache
90====================================================
91 
92Copy keytab and adjust perms::
93 
94 cd /etc/httpd
95 cp /tmp/testweb.foxhop.net.keytab .
96 chown root:apache testweb.foxhop.net.keytab
97 chmod 640 testweb.foxhop.net.keytab
98 
99Test keytab::
100 
101 # you should see a ticket
102 kinit -k -t /etc/httpd/testweb.foxhop.net.keytab HTTP/testweb.foxhop.net
103 klist
104 
105Install custom mod_auth_kerb RPM::
106 
107 rpm -Uvh /usr/local/src/mod_auth_kerb-5.4-0.x86_64.rpm
108 
109Configure Apache2 VirtualHost::
110 
111 vi /etc/httpd/conf.d/000-testweb.foxhop.net.conf::
112 
113  ##################
114  #    Kerberos    #
115  ##################
116 
117    KrbServiceName HTTP
118    KrbAuthRealms AD.FOXHOP.NET
119    Krb5Keytab /etc/httpd/testweb.foxhop.net.keytab
120    KrbMethodNegotiate on
121    KrbMethodK5Passwd on
122    KrbSaveCredentials on
123    # KrbLocalUserMapping removes @REALM | NA in RHEL5 
124    # Compiled custom RPM: /usr/local/src/mod_auth_kerb-5.4-0.x86_64.rpm
125    KrbLocalUserMapping on