kerberos - 将 kerberos 票证的 maxlife 重置为超过 24 小时

标签 kerberos mit-kerberos

我在我的机器上使用 MIT kerberos 5 来验证用户身份。这会将票证授予用户。我想将票证的最长生命周期重置为超过 24 小时。默认情况下,kerberos 票证的最长生命周期为 24 小时。我已尝试以下步骤:

  1. 更改了/var/kerberos/krb5kdc/kdc.conf 我没有找到 max-life 所以我设置了 max_life = 168h 0m 0s
  2. 更改了/etc/krb5.conf 将默认的 Ticket_lifetime 从 24 小时更改为 ticket_lifetime = 168h 0m 0s
  3. 默认情况下,主体生命周期为最长票据生命周期:1 天 00:00:00
  4. 我使用以下命令将其更改为 168h

    kadmin.local:  modify_principal -maxlife 168hours testkerb
    
  5. 已更改为 - 票证最长有效期:7 天 00:00:00

  6. 然后我为用户执行了 kinit 并使用 klist 进行检查。

klist 结果仍然显示票证有效期为 24 小时。 klist的输出如下:

Valid starting     Expires            Service principal
**11/19/14 12:51:59  11/20/14 12:51:59  krbtgt/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="95d0cdd4d8c5d9d0bbd6dad8d5d0cdd4d8c5d9d0bbd6dad8" rel="noreferrer noopener nofollow">[email protected]</a>**
    renew until 11/19/14 12:51:59

如果有人知道请告诉我我在哪里做错了。少于 24 小时我可以更改票证有效期,但超过 24 小时则不会反射(reflect)在 klist 中。我将不胜感激的帮助。

最佳答案

嗨,我得到了工作步骤,所以更新它。要将 kerberos 中票证的最长生命周期从默认的 24 小时更改为超过 24 小时,请按照以下步骤操作:

  1. 添加max_life属性(property)/var/kerberos/krb5kdc/kdc.conf文件。

    max_life = 168h 0m 0s
    
  2. 更改了 /etc/krb5.conf文件。

    ticket_lifetime = 168h 0m 0s
    
  3. 更改了默认主体 krbtgt/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="73362b323e233f365d303c3e33362b323e233f365d303c3e" rel="noreferrer noopener nofollow">[email protected]</a>最长使用生命周期。

    modprinc -maxlife 168hours krbtgt/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="084d50494558444d264b4745484d50494558444d264b4745" rel="noreferrer noopener nofollow">[email protected]</a>
    

现在我们可以将票证有效期设置为 7 天,即 168 小时。我们可以做kinit用户可以通过 klist 检查票证是否过期.

您还可以使用kadmin命令和getprinc查看校长的状态。

kadmin:  getprinc krbtgt/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="33766b727e637f761d707c7e73766b727e637f761d707c7e" rel="noreferrer noopener nofollow">[email protected]</a>
Principal: krbtgt/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fabfa2bbb7aab6bfd4b9b5b7babfa2bbb7aab6bfd4b9b5b7" rel="noreferrer noopener nofollow">[email protected]</a>
Expiration date: [never]
Last password change: Thu Jan 05 15:23:04 EST 2017
Password expiration date: [none]
Maximum ticket life: 0 days 168:00:00
Maximum renewable life: 7 days 00:00:00
Last modified: Fri Jun 30 08:23:23 EDT 2017 (root/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c3a2a7aeaaad83869b828e938f86ed808c8e" rel="noreferrer noopener nofollow">[email protected]</a>)
Last successful authentication: Fri Jun 30 08:16:47 EDT 2017
Last failed authentication: [never]
Failed password attempts: 0
Number of keys: 4
Key: vno 3, arcfour-hmac, no salt
Key: vno 3, des3-cbc-sha1, no salt
Key: vno 3, des-cbc-crc, no salt
Key: vno 3, aes256-cts-hmac-sha1-96, no salt
MKey: vno 1
Attributes: REQUIRES_PRE_AUTH
Policy: [none]

关于kerberos - 将 kerberos 票证的 maxlife 重置为超过 24 小时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27012033/

相关文章:

hadoop - Hadoop Datanode失败,返回值3(启用Kerberos)

Hadoop 安全

linux - 当缓存仍然有凭据时避免 kinit

hadoop - 启用 Kerberos 后无法访问 Hadoop CLI

python - JIRA REST API 和 kerberos 身份验证

java - "Defective token detected"错误(NTLM 不是 Kerberos)与 Kerberos/Spring Security/IE/Active Directory

java - 如何生成 Kerberos 安全 token ?

Kerberos:UPN 和 SPN 之间的区别

java - Java/WebLogic 应用程序中的集成 Windows 身份验证 (NTLM)?