In my Kerberos system:
kinit test
and input passwd
, succeed.kadmin.local -q "xst -k test.keytab test"
.run kinit test
and input passwd
, failed:
kinit: Password incorrect while getting initial credentials
run kinit -k -t test.keytab test
, succeed.
Is this normal ? If not, what are possible reasons?
Thanks.
A keytab is a file containing pairs of Kerberos principals and encrypted keys that are derived from the Kerberos password. You can use this file to log on to Kerberos without being prompted for a password.
The purpose of the Keytab file is to allow the user to access distinct Kerberos Services without being prompted for a password at each Service. Furthermore, it allows scripts and daemons to login to Kerberos Services without the need to store clear-text passwords or for human intervention.
Keytab contains pairs of principal and encrypted keys (which are derived from the Kerberos password), no way to get back the password from these data. Save this answer.
The contents of keytab file can be verified using either Unix/linux ktutil or klist commands or java ktab utility. Alternatively you can also use Klist or Ktab utility that comes with standard java.
I found that the attribute krbLastPwdChange(a timestamp value)
in kerberos's database changed after I run:
kadmin.local -q "xst -k test.keytab test"
While add the option -norandkey
will just create the keytab without changing password:
kadmin.local -q "xst -norandkey -k test.keytab test"
I can not find the detail document about kadmin xst
.
This is by design. You cannot have both a password and a keytab in Kerberos. The reason is if both were enabled, if someone was able to pull a keytab on your behalf or was in possession of a copy of your keytab, then they could masquerade as you and you would never know it. They would be able to generate a TGT via kinit.
By pulling a keytab, the password is invalidated, so if you then tried to log in with a password, you would get an error. And even if you didn't know exactly what was going on, if you reset your password, it would invalidate the keytab.
For one simple reason:
kinit
tells you that the client has not been found in the database, right? By default, when kinit
is invoked with a keytab it uses the default server pricipal to obtain TGT. In your case host/<hostname>@REALM
but your keytab contains a key for principal test@REALM
.
I had this issue too until I have asked the MIT Kereros mailing list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With