1) Configure the KDC for the "EXAMPLE.COM" realm
First we will configure the Apache Kerby KDC for the "EXAMPLE.COM" realm. Follow the previous tutorial to install and configure the KDC for this (default) realm. We need to follow some additional steps to get cross-realm support working with a second KDC in realm "EXAMPLE2.COM". Edit 'conf/krb5.conf' and replace the "realms" section with the following configuration:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[realms] | |
EXAMPLE.COM = { | |
kdc = localhost:12345 | |
} | |
EXAMPLE2.COM = { | |
kdc = localhost:54321 | |
} | |
[domain_realm] | |
.EXAMPLE.COM = example.com | |
EXAMPLE.COM = example.com | |
.EXAMPLE2.COM = example2.com | |
EXAMPLE2.COM = example2.com | |
[capaths] | |
EXAMPLE.COM = { | |
EXAMPLE2.COM = . | |
} | |
EXAMPLE2.COM = { | |
EXAMPLE.COM = . | |
} |
- sh bin/kadmin.sh conf/ -k keytabs/admin.keytab
- addprinc -pw security krbtgt/EXAMPLE2.COM@EXAMPLE.COM
Now we will configure a second KDC for the "EXAMPLE2.COM" realm. Download the Apache Kerby source code as before. Unzip the source and build the distribution via:
- mvn clean install -DskipTests
- cd kerby-dist
- mvn package -Pdist
- sh bin/kdcinit.sh conf keytabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[realms] | |
EXAMPLE.COM = { | |
kdc = localhost:12345 | |
} | |
EXAMPLE2.COM = { | |
kdc = localhost:54321 | |
} | |
[domain_realm] | |
.EXAMPLE.COM = example.com | |
EXAMPLE.COM = example.com | |
.EXAMPLE2.COM = example2.com | |
EXAMPLE2.COM = example2.com | |
[capaths] | |
EXAMPLE.COM = { | |
EXAMPLE2.COM = . | |
} | |
EXAMPLE2.COM = { | |
EXAMPLE.COM = . | |
} |
Next start the KDC via:
- sh bin/start-kdc.sh conf runtime
- sh bin/kadmin.sh conf/ -k keytabs/admin.keytab
- addprinc -pw security krbtgt/EXAMPLE2.COM@EXAMPLE.COM
- addprinc -pw password service@EXAMPLE2.COM
Now we can obtain a service ticket for the service we have configured in the "EXAMPLE2.COM" realm as a user who is authenticated to the "EXAMPLE.COM" realm. Configure the "tool-dist" distribution as per the previous tutorial, updating 'conf/krb5.conf' with the same "realms", "domain_realm" and "capaths" information as shown above. Now we can authenticate as "alice" and obtain a service ticket as follows:
- sh bin/kinit.sh -conf conf alice@EXAMPLE.COM
- sh bin/kinit.sh -conf conf -c /tmp/krb5cc_1000 -S service@EXAMPLE2.COM
No comments:
Post a Comment