我正在自动化一个需要访问kerberized资源的服务。 无密码 kinit 使用按键可以很好地工作。然后连接资源 使用SASL。
kinit
有没有办法(可能通过GSSAPI或libkrb5)确保TGT存在 无论何时访问资源?分叉 基尼特 每次访问之前 似乎是一件务实的事情。然而,两者之间存在着明显的竞争 TGT获取时间及其用于获取我想要避免的TGS。
基尼特
我想象一下,接收fd进行身份验证,其有效性是 直到用户关闭为止。
我更喜欢远离重型解决方案,如 自动续订 TGT。
答案是提供 客户 KRB5_CLIENT_KTNAME 参数:
KRB5_CLIENT_KTNAME
If no existing tickets are available for the desired name, but the name has an entry in the default client keytab, the krb5 mechanism will acquire initial tickets for the name using the default client keytab.
从 MIT Kerberos docs .
wiki还有一个 write-up of the implementation .