美文网首页
freeIPA的sudo policy不生效问题

freeIPA的sudo policy不生效问题

作者: 迷茫_小青年 | 来源:发表于2018-11-08 17:15 被阅读0次

我们在freeipa里有时候会针对某个用户,或是某个主机进行一些sudo的控制。

这个时候就可能会碰见,在policy里明明加了这个用户可以使用sudo。但是在主机上并生效,反复折腾折腾或是重启一下sssd 就好了。

今儿有时间针对这个问题,仔细找资料看看。原来这是因为sssd有缓存。
sssd缓存目录在/var/lib/sss/db/

其中有两个非常重要的参数控制着sudo策略。

ldap_sudo_full_refresh_interval (integer)
How many seconds SSSD will wait between executing a full refresh of sudo rules (which downloads all rules that are stored on the server).
The value must be greater than ldap_sudo_smart_refresh_interval

Default: 21600 (6 hours)

ldap_sudo_smart_refresh_interval (integer)
How many seconds SSSD has to wait before executing a smart refresh of sudo rules (which downloads all rules that have USN higher than the highest USN of cached rules).
If USN attributes are not supported by the server, the modifyTimestamp attribute is used instead.

Default: 900 (15 minutes)

原来sssd定时把sudo policy缓存在自己的本地了。然后定时定时更新。
默认每6个小时完全刷新一次,每15分钟增量更新一次。

知道这两个参数以后,把这两个参数配置在sssd.conf

[domain/ff.com]
debug_level = 0x3ff0  #debug level
ldap_sudo_full_refresh_interval = 3600
ldap_sudo_smart_refresh_interval = 30

ok , 再次重启sssd 。测试sudo policy 基本是准实时生效了。

相关文章

网友评论

      本文标题:freeIPA的sudo policy不生效问题

      本文链接:https://www.haomeiwen.com/subject/fxgwxqtx.html