I'm having trouble exporting and importing kerberos keys into openafs.
My first problem is that when using addprinc and ktadd commands in kadmin.local, the encryption key type -e option appears to be ignored. For example when I try to add a key of type des-cbc-crc:v4, a key of type aes256-cts-hmac-sha1-96 appears to be added instead:
kadmin.local: ktadd -e des-cbc-crc:v4 -k /tmp/afs.ktab afs Entry for principal afs with kvno 4, encryption type aes256-cts-hmac-sha1-96 added to keytab WRFILE:/tmp/afs.ktab. Entry for principal afs with kvno 4, encryption type aes128-cts-hmac-sha1-96 added to keytab WRFILE:/tmp/afs.ktab. The same happens with addprinc, I try to specify -e DES-CBC-CRC:md5 for the key type but this appears to be ignored and end up with a aes128-cts-hmac-sha1-96 key:
$ kadmin.local Authenticating as principal root/[email protected] with password. kadmin.local: addprinc -policy service -randkey -e DES-CBC-CRC:md5 afs WARNING: policy "service" does not exist Principal "[email protected]" created. kadmin.local: getprinc afs Principal: [email protected] Expiration date: [never] Last password change: Mon May 27 18:22:21 EDT 2024 Password expiration date: [never] Maximum ticket life: 0 days 10:00:00 Maximum renewable life: 7 days 00:00:00 Last modified: Mon May 27 18:22:21 EDT 2024 (root/[email protected]) Last successful authentication: [never] Last failed authentication: [never] Failed password attempts: 0 Number of keys: 2 Key: vno 1, aes256-cts-hmac-sha1-96 Key: vno 1, aes128-cts-hmac-sha1-96 MKey: vno 1 Attributes: REQUIRES_PRE_AUTH Policy: service [does not exist] kadmin.local: Additionally, when I try to import this key using asetkey, I get an unreadable error message:
sudo asetkey add 4 /tmp/afs.ktab afs asetkey: unknown RPC error (-1765328203) for keytab entry with Principal [email protected], kvno 4, DES-CBC-CRC/MD5/MD4 Reading the asetkey manpage I see a strong recommendation against using the des-cbc-crc key type and using the rxkad-k5 extension instead:
A modern AFS cell should be using the rxkad-k5 extension, or risks terribly insecure operation (complete cell compromise for $100 in 1 day). The keys used for rxkad-k5 operation are stored in the KeyFileExt. Cells not using the rxkad-k5 extension (i.e., stock rxkad) use keys of the des-cbc- crc encryption type, which are stored in the KeyFile. Reading further, the KeyFileExt man page says that trying to add rxkad-k5 keys requires specifying a krb5 encryption type number, which is distinct from a string identifier:
Using asetkey(8) to add rxkad-k5 keys to the KeyFileExt also requires specifying a krb5 encryption type number. Since the encryption type must be specified by its number (not a symbolic or string name), care must be taken to determine the correct encryption type to add. I'm stuck with a lot of related questions:
Why does
kadminappear to ignore my specified encryption type?How do I determine if my openafs is using the
rxkad-k5extension? I searched debian packages viaapt-cache search rxkad-k5andrxkadand found nothing.Since
aes256-cts-hmac-sha1-96looks like a string identifier, how can I determine the "krb5 encryption type number" for this encryption in order to import it via asetkey?I noticed
openafs-krb5is a separate package fromopenafs-{fileserver,dbserver,client}. Is there a recommended way of managing openafs authentication on debian without setting up kerberos?I found that
akeyconvertclaims to help importing keysfrom the krb5 keytab format to the KeyFileExt format. Should I be usingakeyconvertto convert myafs.keytabkey into openafs?