I am attempting to get a test Kerberos client/server pair working against Active Directory. I have created three users in a spare domain in our corporate network, "RichardC", "Server1" and "Server2". My Server users have been mapped to different Service Principal Names, one with KRB5_NT_PRINCIPAL, the other with KRB5_NT_SRV_HOST.
ktpass -out server2.keytab
-princ server2/[email protected]
-mapuser [email protected]
-pass ThePassword
-crypto All
-pType KRB5_NT_SRV_HOST
-kvno 2
I have not used the +DesOnly option this time, hoping that in today's systems I don't need DES. I have replaced the real domain name with mydomain in this question to avoid management concern.
This gives me a keytab. I can klist it:
KVNO Principal
---- --------------------------------------------------------------------------
2 server2/[email protected] (DES cbc mode with CRC-32)
2 server2/[email protected] (DES cbc mode with RSA-MD5)
2 server2/[email protected] (ArcFour with HMAC/md5)
2 server2/[email protected] (AES-256 CTS mode with 96-bit SHA-1 HMAC)
2 server2/[email protected] (AES-128 CTS mode with 96-bit SHA-1 HMAC)
I can even use kinit -k to log in using the key from the keytab - so it seems to work.
I have both my own test program, and failing that the test program from http://download.oracle.com/docs/cd/E19683-01/816-1331/sampleprogs-1/index.html. In that program, on the server, I have changed GSS_C_NT_HOSTBASED_SERVICE to GSS_C_NT_USER_NAME with both keytabs to make it recognise the name. I am running the Oracle Demo server as
./gss-server -mech 1.2.840.113554.1.2.2 server2/serbia.mydomain.com
and the client
./gss-client -mech 1.2.840.113554.1.2.2 serbia.mydomain.com server2 "Hello"
The result:
GSS-API error accepting context: Invalid credential was supplied
GSS-API error accepting context: Service key not available
In both this case and with my own test code the error happens after the client has sent its first token, while the server is trying to decode it.
klist shows the key granted for the client. It is using ArcFour, which is in the keytab
Default principal: [email protected]
Valid starting Expires Service principal
07/25/11 17:36:49 07/26/11 03:35:18 krbtgt/[email protected]
renew until 08/01/11 17:36:49
07/25/11 17:36:03 07/26/11 03:35:18 server2/[email protected]
renew until 08/01/11 17:36:03
The UNIX machine (Serbia) could conceivably belong to another realm (the one I've called mydomain.com here), though it does not appear to have Kerberos setup. I am using a local krb5.conf file which I have pointed to the BENCHMARKING.RDDEV.LOCAL realm, though if the machine tries to use the DNS with its host name it may get the wrong answer. My krb5.conf has
[libdefaults]
default_keytab_name = /users/dev/core/richardc/server1.keytab
default_realm = BENCHMARKING.RDDEV.LOCAL
dns_lookup_kdc = false
default_tkt_types = DES-CBC-MD5
[realms]
BENCHMARKING.RDDEV.LOCAL = {
kdc = gbha-dcbench01p.benchmarking.rddev.local
admin_server = gbha-dcbench01p.benchmarking.rddev.local
}
[domain_realm]
benchmarking.rddev.local = BENCHMARKING.RDDEV.LOCAL
.benchmarking.rddev.local = BENCHMARKING.RDDEV.LOCAL
mydomain.com = BENCHMARKING.RDDEV.LOCAL
.mydomain.com = BENCHMARKING.RDDEV.LOCAL
It looks like options such as default_tkt_types have been ineffective.
Question is - how do I fix my error?
Thanks - Richard