kinit: KDC can‘t fulfill requested option while renewing credentials

文章目录

  • kinit: KDC can't fulfill requested option while renewing credentials
    • 背景
    • 解决

kinit: KDC can’t fulfill requested option while renewing credentials

背景

在测试集群上装上了kerberos,今天同事需要使用kinit -R 命令,在执行时报错

kinit -R
kinit: KDC can't fulfill requested option while renewing credentials

解决

1,检查配置文件/var/kerberos/krb5kdc/kdc.conf,在[realms]下需要有max_renewable_life = 7d

完整配置如下:

[kdcdefaults]
 kdc_ports = 88
 kdc_tcp_ports = 88

[realms]
 AM.COM = {
  #master_key_type = aes256-cts
  acl_file = /var/kerberos/krb5kdc/kadm5.acl
  dict_file = /usr/share/dict/words
  max_renewable_life = 7d #这个必须有
  admin_keytab = /var/kerberos/krb5kdc/kadm5.keytab
  supported_enctypes = aes256-cts:normal aes128-cts:normal des3-hmac-sha1:normal arcfour-hmac:normal camellia256-cts:normal camellia128-cts:normal des-hmac-sha1:normal des-cbc-md5:normal des-cbc-crc:normal
 }

2.修改配置后需要重启

systemctl restart krb5kdc

3.klist 查看cache文件 或者在/etc/krb5.conf中查看相应的配置文件,推荐使用klist

 klist
Ticket cache: FILE:/tmp/krb5cc_0 #这里是cache文件位置
Default principal: [email protected]

Valid starting       Expires              Service principal
09/22/2022 09:53:48  09/23/2022 09:53:48  krbtgt/[email protected]

/etc/krb5.conf

kinit: KDC can‘t fulfill requested option while renewing credentials_第1张图片

4.执行以下命令修改maxrenewlife
为啥推荐使用klist,执行命令需要和和klist中的Default principal: [email protected]对应

kadmin.local -q 'modprinc -maxrenewlife "1 week" +allow_renewable [email protected]'

kinit: KDC can‘t fulfill requested option while renewing credentials_第2张图片

5.清除cache

rm -rf /tmp/krb5cc_*

6.重新认证

kinit -kt /tmp/root.keytab root

7.klist查看出现 renew until字样说明成功

klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: [email protected]

Valid starting       Expires              Service principal
09/22/2022 09:56:58  09/23/2022 09:56:58  krbtgt/[email protected]
        renew until 09/29/2022 09:56:58

8.重新执行kinit -R成功

[root@master tmp]# kinit -R
You have new mail in /var/spool/mail/root
[root@master tmp]# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: [email protected]

Valid starting       Expires              Service principal
09/22/2022 10:24:32  09/23/2022 10:24:32  krbtgt/[email protected]
        renew until 09/29/2022 09:59:04

你可能感兴趣的:(大数据,HDP,大数据,kerberos,hadoop)