Este contenido no está disponible en el idioma seleccionado.
A.2. Troubleshooting sudo with SSSD and sudo Debugging Logs
A.2.1. SSSD and sudo Debug Logging Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
The debug logging feature enables you to log additional information about SSSD and sudo.
The sudo Debug Log File
To enable sudo debugging:
- Add the following lines to
/etc/sudo.conf:Debug sudo /var/log/sudo_debug.log all@debug Debug sudoers.so /var/log/sudo_debug.log all@debug
Debug sudo /var/log/sudo_debug.log all@debug Debug sudoers.so /var/log/sudo_debug.log all@debugCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the
sudocommand as the user you want to debug.
The
/var/log/sudo_debug.log file is created automatically and provides detailed information to answer questions like:
- What information is available about the user and the environment when running the
sudocommand?Copy to Clipboard Copied! Toggle word wrap Toggle overflow - What data sources are used to fetch sudo rules?
sudo[22259] <- sudo_parseln @ ./fileops.c:178 := sudoers: files sss
sudo[22259] <- sudo_parseln @ ./fileops.c:178 := sudoers: files sssCopy to Clipboard Copied! Toggle word wrap Toggle overflow - SSSD plug-in starts with this line:
sudo[22259] <- sudo_sss_open @ ./sssd.c:305 := 0
sudo[22259] <- sudo_sss_open @ ./sssd.c:305 := 0Copy to Clipboard Copied! Toggle word wrap Toggle overflow - How many rules did SSSD return?
sudo[22259] Received 3 rule(s)
sudo[22259] Received 3 rule(s)Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Does a rule match or not?
sudo[22259] sssd/ldap sudoHost 'ALL' ... MATCH! sudo[22259] <- user_in_group @ ./pwutil.c:1010 := false
sudo[22259] sssd/ldap sudoHost 'ALL' ... MATCH! sudo[22259] <- user_in_group @ ./pwutil.c:1010 := falseCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The SSSD Debug Log Files
To enable SSSD debugging:
- Add the
debug_leveloption to the[sudo]and[domain/domain_name]sections of your/etc/sssd/sssd.conffile:[domain/domain_name] debug_level = 0x3ff0 ... [sudo] debug_level = 0x3ff0
[domain/domain_name] debug_level = 0x3ff0 ... [sudo] debug_level = 0x3ff0Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart SSSD:
systemctl restart sssd
# systemctl restart sssdCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the
sudocommand to write the debug information to the log files.
The following log files are created:
- The domain log file:
/var/log/sssd/sssd_domain_name.log - This log file helps you to answer questions like:
- How many rules did SSSD return?
[sdap_sudo_refresh_load_done] (0x0400): Received 4-rules rules
[sdap_sudo_refresh_load_done] (0x0400): Received 4-rules rulesCopy to Clipboard Copied! Toggle word wrap Toggle overflow - What sudo rules did SSSD download from the server?
[sssd[be[LDAP.PB]]] [sysdb_save_sudorule] (0x0400): Adding sudo rule demo-name
[sssd[be[LDAP.PB]]] [sysdb_save_sudorule] (0x0400): Adding sudo rule demo-nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Are the matching rules stored in the cache?
[sdap_sudo_refresh_load_done] (0x0400): Sudoers is successfully stored in cache
[sdap_sudo_refresh_load_done] (0x0400): Sudoers is successfully stored in cacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow - What filter was used to download the rules from the server?
[sdap_get_generic_ext_step] (0x0400): calling ldap_search_ext with [(&(objectClass=sudoRole)(|(!(sudoHost=*))(sudoHost=ALL)(sudoHost=client.example.com)(sudoHost=client)(sudoHost=192.0.2.1)(sudoHost=192.0.2.0/24)(sudoHost=2620:52:0:224e:21a:4aff:fe23:1394)(sudoHost=2620:52:0:224e::/64)(sudoHost=fe80::21a:4aff:fe23:1394)(sudoHost=fe80::/64)(sudoHost=+*)(|(sudoHost=*\\*)(sudoHost=*?*)(sudoHost=*\2A*)(sudoHost=*[*]*))))][dc=example,dc=com]
[sdap_get_generic_ext_step] (0x0400): calling ldap_search_ext with [(&(objectClass=sudoRole)(|(!(sudoHost=*))(sudoHost=ALL)(sudoHost=client.example.com)(sudoHost=client)(sudoHost=192.0.2.1)(sudoHost=192.0.2.0/24)(sudoHost=2620:52:0:224e:21a:4aff:fe23:1394)(sudoHost=2620:52:0:224e::/64)(sudoHost=fe80::21a:4aff:fe23:1394)(sudoHost=fe80::/64)(sudoHost=+*)(|(sudoHost=*\\*)(sudoHost=*?*)(sudoHost=*\2A*)(sudoHost=*[*]*))))][dc=example,dc=com]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use this filter to look up the rules in the IdM database:ldapsearch -x -D "cn=Directory Manager" -W -H ldap://server.example.com -b dc=example,dc=com '(&(objectClass=sudoRole)...)'
# ldapsearch -x -D "cn=Directory Manager" -W -H ldap://server.example.com -b dc=example,dc=com '(&(objectClass=sudoRole)...)'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- The sudo responder log file:
/var/log/sssd/sssd_sudo.log - This log file helps you to answer questions like:
- How many rules did SSSD return?
[sssd[sudo]] [sudosrv_get_sudorules_from_cache] (0x0400): Returning 4-rules rules for [user@idm.example.com]
[sssd[sudo]] [sudosrv_get_sudorules_from_cache] (0x0400): Returning 4-rules rules for [user@idm.example.com]Copy to Clipboard Copied! Toggle word wrap Toggle overflow - What filter was applied for searching the cache of SSSD?
[sudosrv_get_sudorules_query_cache] (0x0200): Searching sysdb with [(&(objectClass=sudoRule)(|(sudoUser=ALL)(sudoUser=user)(sudoUser=#10001)(sudoUser=%group-1)(sudoUser=%user)(sudoUser=+*)))]
[sudosrv_get_sudorules_query_cache] (0x0200): Searching sysdb with [(&(objectClass=sudoRule)(|(sudoUser=ALL)(sudoUser=user)(sudoUser=#10001)(sudoUser=%group-1)(sudoUser=%user)(sudoUser=+*)))]Copy to Clipboard Copied! Toggle word wrap Toggle overflow - How do I look up the rules returned from the SSSD cache? Use the following filter to look up the rules:
ldbsearch -H /var/lib/sss/db/cache_domain_name.ldb -b cn=sysdb '(&(objectClass=sudoRule)...)'
# ldbsearch -H /var/lib/sss/db/cache_domain_name.ldb -b cn=sysdb '(&(objectClass=sudoRule)...)'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
Theldbsearchutility is included in the ldb-tools package.