我在将 Kerberos 密钥导出和导入 openafs 时遇到了麻烦。
我的第一个问题是,当使用addprinc
和ktadd
命令时kadmin.local
,加密密钥类型-e
选项似乎被忽略。例如,当我尝试添加 type 的键时,似乎会添加des-cbc-crc:v4
type 的键:aes256-cts-hmac-sha1-96
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.
同样的情况也发生在 addprinc 上,我尝试指定-e DES-CBC-CRC:md5
密钥类型,但这似乎被忽略了,最终得到了一个aes128-cts-hmac-sha1-96
密钥:
$ 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:
此外,当我尝试使用 导入此密钥时asetkey
,我收到一条不可读的错误消息:
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
阅读asetkey
联机帮助页时,我看到强烈建议不要使用des-cbc-crc
密钥类型并使用rxkad-k5
扩展名:
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.
进一步阅读,KeyFileExt
手册页说尝试添加rxkad-k5
键需要指定一个krb5 encryption type number
,它与字符串标识符不同:
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.
我被很多相关的问题困扰着:
为什么
kadmin
似乎忽略我指定的加密类型?如何确定我的 openafs 是否正在使用该
rxkad-k5
扩展?我通过apt-cache search rxkad-k5
和搜索了 debian 软件包,rxkad
但什么也没找到。由于
aes256-cts-hmac-sha1-96
看起来像一个字符串标识符,我如何确定此加密的“krb5 加密类型编号”以便通过 asetkey 导入它?我注意到
openafs-krb5
是来自的一个单独的包openafs-{fileserver,dbserver,client}
。有没有推荐的方法来管理 debian 上的 openafs 身份验证而无需设置 kerberos?我发现
akeyconvert
声称可以帮助导入密钥from the krb5 keytab format to the KeyFileExt format
。我应该使用akeyconvert
它来将密钥转换afs.keytab
为 openafs 吗?