我正在尝试使用ktutil做一个keytab。 我可以selectencryptiontypes,但是ktutil手册页没有提供可能的select列表。 我也不知道哪种encryption方法是最好的! 我怎样才能找出这两个? 我想要最强大的encryptionfunction。
$ ktutil > add_entry -password -p [email protected] -k 1 -e [what goes here?!]
84104提供的ktutil解决scheme是正确的,如果您正在尝试为服务制作keytab。 这是一个可怕的想法,你想要用于一些自动化的过程密钥表,因为它会随机密码,并使该帐户无法使用密钥表不可用。
如果您使用keytab作为密码存储库来提供给kinit来自动执行进程,那么我build议您使用您在使用密码运行kinit时获得的任何enctype。
klist -e
将列出一堆你想要的行是这一个。 使用与ktutil列出的etype。
Etype (skey, tkt): aes256-cts-hmac-sha1-96, aes256-cts-hmac-sha1-96
需要警告的是,这种使用ktutil与将密码存储在明文文件中完全相同,任何可以读取密钥表的人都可以将您的身份模仿到系统中。 另外这些命令是MIT的版本,heimdal ktutil和klist有些不同(Heimdal是最新版本的OS X上使用的Kerberos版本)
不要使用ktutil除非您正在尝试从现有的密钥表制作密钥表。 使用kadmin代替。
# kadmin -p user/admin Password for user/[email protected]: kadmin: add_principal -randkey service/server.example.com WARNING: no policy specified for service/[email protected]; defaulting to no policy Principal "service/[email protected]" created. kadmin: ktadd -k /etc/service/service.keytab service/server.example.com Entry for principal service/server.example.com with kvno 2, encryption type aes256-cts-hmac-sha1-96 added to keytab Entry for principal service/server.example.com with kvno 2, encryption type camellia256-cts-cmac added to keytab kadmin: quit
根据您的kdc的kdc.conf您可能会得到不同的encryption:盐types。 默认列表是:
aes256-cts-hmac-sha1-96:normal aes128-cts-hmac-sha1-96:normal des3-cbc-sha1:normal arc‐four-hmac-md5:normal
您也可以使用-e和指定所需的types来限制(或扩展)在keytab中使用的enctypes。
如果您正试图从现有的密钥表中创build密钥表:
# kutil ktutil: read_kt /etc/krb5.keytab ktutil: l -e slot KVNO Principal ---- ---- --------------------------------------------------------------------- 1 6 host/[email protected] (aes256-cts-hmac-sha1-96) 2 6 host/[email protected] (camellia256-cts-cmac) 3 3 HTTP/[email protected] (aes256-cts-hmac-sha1-96) 4 3 HTTP/[email protected] (camellia256-cts-cmac) ktutil: delete_entry 1 ktutil: l -e slot KVNO Principal ---- ---- --------------------------------------------------------------------- 1 6 host/[email protected] (camellia256-cts-cmac) 2 3 HTTP/[email protected] (aes256-cts-hmac-sha1-96) 3 3 HTTP/[email protected] (camellia256-cts-cmac) ktutil: delete_entry 1 ktutil: l -e slot KVNO Principal ---- ---- --------------------------------------------------------------------- 1 3 HTTP/[email protected] (aes256-cts-hmac-sha1-96) 2 3 HTTP/[email protected] (camellia256-cts-cmac) ktutil: write_kt /etc/httpd/http.keytab ktutil: quit # klist -ke /etc/httpd/http.keytab Keytab name: FILE:/etc/httpd/http.keytab KVNO Principal ---- --------------------------------------------------------------------- 3 HTTP/[email protected] (aes256-cts-hmac-sha1-96) 3 HTTP/[email protected] (camellia256-cts-cmac)
我必须做
add_entry -password -p [email protected] -k 1 -e arcfour-hmac write_kt keytab
使用VAS附带的kinit时。 注意arcfour-hmac
然后
kinit -kt keytab [email protected]
奇迹般有效。