KrbError: ('Principal not found in keytab', -1)

Viewed 773

I am trying to test the principal of the keytab file by using this code:

import kerberos
principal = kerberos.getServerPrincipalDetails('HTTP/testdc.testing.gc', 'TESTING.GC')

I got the keytab as a environment variable: export KRB5_KTNAME=/etc/key_tab_file And the content of this keytab:

^E^B^@^@^@T^@^B^@
TESTING.GC^@^DHTTP^@^Qtestdc.testing.gc^@^@^@^A^@^@^@^@^C^@^R^@ ▒-▒~A\ڳ▒^H▒F▒xb^C^X▒Gy▒q▒▒I▒▒▒~^▒~UDd

But I keep constantly receive an KrbError: ('Principal not found in keytab', -1) after trying to initiate it.

This step is described as part of the flask-kerberos initialize processes:

https://github.com/mkomitee/flask-kerberos/blob/master/flask_kerberos.py#L33

What am I doing wrong? I tried various of options as the service and the host arguments of this method, nothing worked..

1 Answers

Solved the issue, it suppose to be only the service name (http) and the DNS\DC server (testdc.testing.gc).

Related