Do the mechanisms you list work for constrained delegation?
krb5 version: 1.16.1
I'm testing with t_s4u using the same approach above ( KRB5CCNAME=DIR:/tmp/mydir) etc.
My tests always use #3 (last kinit command run or kswitch). I'd really like to use #2 if possible.
I can't seem to get the .k5identity or realm of target service to heuristic(s) to kick in.
NOTE: each keytab has been successfully tested using FILE: or DIR (being the last kinit)
/etc/krb5.conf
#START krb5.conf
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm =
UICSYNERGY.BIZ
dns_lookup_realm = true
dns_lookup_kdc = true
dns_canonicalize_hostname = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
default_client_keytab_name = /etc/krb5.keytab
[realms]
UICSYNERGY.BIZ = {
kdc =
uicsynergy.biz
default_domain =
uicsynergy.biz
}
ICSYNERGY.NET = {
kdc =
icsynergy.net
default_domain =
icsynergy.net
}
[domain_realm]
.
uicsynergy.biz =
UICSYNERGY.BIZ
uicsynergy.biz =
UICSYNERGY.BIZ
.
icsynergy.net =
ICSYNERGY.NET
icsynergy.net =
ICSYNERGY.NET
#END krb5.conf
Steps:
Create a keytab on each AD DC.
$ mkdir /tmp/mydir
$ export KRB5CCNAME=DIR:/tmp/mydir
$ kinit -k -t ./spgateway_icsynergy_net.keytab host/
gw.icsyn...@ICSYNERGY.NET
$ kinit -k -t ./spgateway_uicsynergy_biz.keytab host/
gw.icsyn...@UICSYNERGY.BIZ
$ klist -A
Ticket cache: DIR::/tmp/mydir/tktCzQyfj
Default principal: host/
gw.icsyn...@UICSYNERGY.BIZ
Valid starting Expires Service principal
07/24/2018 16:49:20 07/25/2018 02:49:20 krbtgt/
UICSYNE...@UICSYNERGY.BIZ
renew until 07/31/2018 16:49:20
Ticket cache: DIR::/tmp/mydir/tktVQeLF4
Default principal: host/
gw.icsyn...@ICSYNERGY.NET
Valid starting Expires Service principal
07/24/2018 16:48:47 07/25/2018 02:48:47 krbtgt/
ICSYNE...@ICSYNERGY.NET
renew until 07/31/2018 16:48:47
>> WORKS
$ /opt/spgateway/bin/t_s4u
u:tus...@UICSYNERGY.BIZ h:HT...@ics-dc-2.uicsynergy.biz ./spgateway_uicsynergy_biz.keytab
<< WORKS
>> FAILS
$ /opt/spgateway/bin/t_s4u
u:tus...@ICSYNERGY.NET h:HT...@ics-dc-1.icsynergy.net ./spgateway_icsynergy_net.keytab
Protocol transition tests follow
-----------------------------------
[25007] 1532451100.523203: Getting credentials
tus...@ICSYNERGY.NET -> host/
gw.icsyn...@UICSYNERGY.BIZ using ccache DIR::/tmp/mydir/tktCzQyfj
[25007] 1532451100.523204: Retrieving
tus...@ICSYNERGY.NET -> host/
gw.icsyn...@UICSYNERGY.BIZ from DIR::/tmp/mydir/tktCzQyfj with result: -1765328243/Matching credential not found (filename: /tmp/mydir/tktCzQyfj)
[25007] 1532451100.523205: Getting credentials host/
gw.icsyn...@UICSYNERGY.BIZ -> krbtgt/
ICSYNE...@UICSYNERGY.BIZ using ccache DIR::/tmp/mydir/tktCzQyfj
[25007] 1532451100.523206: Retrieving host/
gw.icsyn...@UICSYNERGY.BIZ -> krbtgt/
ICSYNE...@UICSYNERGY.BIZ from DIR::/tmp/mydir/tktCzQyfj with result: -1765328243/Matching credential not found (filename: /tmp/mydir/tktCzQyfj)
[25007] 1532451100.523207: Retrieving host/
gw.icsyn...@UICSYNERGY.BIZ -> krbtgt/
UICSYNE...@UICSYNERGY.BIZ from DIR::/tmp/mydir/tktCzQyfj with result: 0/Success
[25007] 1532451100.523208: Starting with TGT for client realm: host/
gw.icsyn...@UICSYNERGY.BIZ -> krbtgt/
UICSYNE...@UICSYNERGY.BIZ
[25007] 1532451100.523209: Requesting tickets for krbtgt/
ICSYNE...@UICSYNERGY.BIZ, referrals on
[25007] 1532451100.523210: Generated subkey for TGS request: aes256-cts/B5F0
[25007] 1532451100.523211: etypes requested in TGS request: aes256-cts, aes128-cts, aes256-sha2, aes128-sha2, des3-cbc-sha1, rc4-hmac, camellia128-cts, camellia256-cts
[25007] 1532451100.523213: Encoding request body and padata into FAST request
[25007] 1532451100.523214: Sending request (1769 bytes) to
UICSYNERGY.BIZ
[25007] 1532451100.523215: Resolving hostname
uicsynergy.biz
[25007] 1532451100.523216: Initiating TCP connection to stream
192.168.0.180:88
[25007] 1532451100.523217: Sending TCP request to stream
192.168.0.180:88
[25007] 1532451100.523218: Received answer (99 bytes) from stream
192.168.0.180:88
[25007] 1532451100.523219: Terminating TCP connection to stream
192.168.0.180:88
[25007] 1532451100.523220: Sending DNS URI query for _
kerberos.UICSYNERGY.BIZ.
[25007] 1532451100.523221: No URI records found
[25007] 1532451100.523222: Sending DNS SRV query for _kerberos-master._
udp.UICSYNERGY.BIZ.
[25007] 1532451100.523223: Sending DNS SRV query for _kerberos-master._
tcp.UICSYNERGY.BIZ.
[25007] 1532451100.523224: No SRV records found
[25007] 1532451100.523225: Response was not from master KDC
[25007] 1532451100.523226: TGS request result: -1765328377/Server not found in Kerberos database
[25007] 1532451100.523227: Requesting tickets for krbtgt/
ICSYNE...@UICSYNERGY.BIZ, referrals off
[25007] 1532451100.523228: Generated subkey for TGS request: aes256-cts/30A5
[25007] 1532451100.523229: etypes requested in TGS request: aes256-cts, aes128-cts, aes256-sha2, aes128-sha2, des3-cbc-sha1, rc4-hmac, camellia128-cts, camellia256-cts
[25007] 1532451100.523231: Encoding request body and padata into FAST request
[25007] 1532451100.523232: Sending request (1769 bytes) to
UICSYNERGY.BIZ
[25007] 1532451100.523233: Resolving hostname
uicsynergy.biz
[25007] 1532451100.523234: Initiating TCP connection to stream
192.168.0.180:88
[25007] 1532451100.523235: Sending TCP request to stream
192.168.0.180:88
[25007] 1532451100.523236: Received answer (99 bytes) from stream
192.168.0.180:88
[25007] 1532451100.523237: Terminating TCP connection to stream
192.168.0.180:88
[25007] 1532451100.523238: Sending DNS URI query for _
kerberos.UICSYNERGY.BIZ.
[25007] 1532451100.523239: No URI records found
[25007] 1532451100.523240: Sending DNS SRV query for _kerberos-master._
udp.UICSYNERGY.BIZ.
[25007] 1532451100.523241: Sending DNS SRV query for _kerberos-master._
tcp.UICSYNERGY.BIZ.
[25007] 1532451100.523242: No SRV records found
[25007] 1532451100.523243: Response was not from master KDC
[25007] 1532451100.523244: TGS request result: -1765328377/Server not found in Kerberos database
gss_acquire_cred_impersonate_name: Unspecified GSS failure. Minor code may provide more information
gss_acquire_cred_impersonate_name: Server not found in Kerberos database
<< FAILS