此内容没有您所选择的语言版本。

13.2.28. Managing the SSSD Cache


SSSD can define multiple domains of the same type and different types of domain. SSSD maintains a separate database file for each domain, meaning each domain has its own cache. These cache files are stored in the /var/lib/sss/db/ directory.

Purging the SSSD Cache

As LDAP updates are made to the identity provider for the domains, it can be necessary to clear the cache to reload the new information quickly.
The cache purge utility, sss_cache, invalidates records in the SSSD cache for a user, a domain, or a group. Invalidating the current records forces the cache to retrieve the updated records from the identity provider, so changes can be realized quickly.

Note

This utility is included with SSSD in the sssd package.
Most commonly, this is used to clear the cache and update all records:
~]# sss_cache -E
The sss_cache command can also clear all cached entries for a particular domain:
~]# sss_cache -Ed LDAP1
If the administrator knows that a specific record (user, group, or netgroup) has been updated, then sss_cache can purge the records for that specific account and leave the rest of the cache intact:
~]# sss_cache -u jsmith
Table 13.12. Common sss_cache Options
Short Argument Long Argument Description
-E --everything Invalidates all cached entries with the exception of sudo rules.
-d name --domain name Invalidates cache entries for users, groups, and other entries only within the specified domain.
-G --groups Invalidates all group records. If -g is also used, -G takes precedence and -g is ignored.
-g name --group name Invalidates the cache entry for the specified group.
-N --netgroups Invalidates cache entries for all netgroup cache records. If -n is also used, -N takes precedence and -n is ignored.
-n name --netgroup name Invalidates the cache entry for the specified netgroup.
-U --users Invalidates cache entries for all user records. If the -u option is also used, -U takes precedence and -u is ignored.
-u name --user name Invalidates the cache entry for the specified user.

Deleting Domain Cache Files

All cache files are named for the domain. For example, for a domain named exampleldap, the cache file is named cache_exampleldap.ldb.
Be careful when you delete a cache file. This operation has significant effects:
  • Deleting the cache file deletes all user data, both identification and cached credentials. Consequently, do not delete a cache file unless the system is online and can authenticate with a user name against the domain's servers. Without a credentials cache, offline authentication will fail.
  • If the configuration is changed to reference a different identity provider, SSSD will recognize users from both providers until the cached entries from the original provider time out.
    It is possible to avoid this by purging the cache, but the better option is to use a different domain name for the new provider. When SSSD is restarted, it creates a new cache file with the new name and the old file is ignored.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.