今天当我启动系统时,收到以下错误消息:
Jan 07 19:38:25 ubuntu20 systemd[1]: Condition check resulted in System Security Services Daemon being skipped.
Jan 07 19:38:25 ubuntu20 systemd[1]: Reached target User and Group Name Lookups.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-nss.socket: Bound to unit sssd.service, but unit isn't active.
Jan 07 19:38:25 ubuntu20 systemd[1]: Dependency failed for SSSD NSS Service responder socket.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-nss.socket: Job sssd-nss.socket/start failed with result 'dependency'.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-autofs.socket: Bound to unit sssd.service, but unit isn't active.
Jan 07 19:38:25 ubuntu20 systemd[1]: Dependency failed for SSSD AutoFS Service responder socket.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-autofs.socket: Job sssd-autofs.socket/start failed with result 'dependency'.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-pac.socket: Bound to unit sssd.service, but unit isn't active.
Jan 07 19:38:25 ubuntu20 systemd[1]: Dependency failed for SSSD PAC Service responder socket.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-pac.socket: Job sssd-pac.socket/start failed with result 'dependency'.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-pam-priv.socket: Bound to unit sssd.service, but unit isn't active.
Jan 07 19:38:25 ubuntu20 systemd[1]: Dependency failed for SSSD PAM Service responder private socket.
Jan 07 19:38:25 ubuntu20 systemd[1]: Dependency failed for SSSD PAM Service responder socket.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-pam.socket: Job sssd-pam.socket/start failed with result 'dependency'.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-pam-priv.socket: Job sssd-pam-priv.socket/start failed with result 'dependency'.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-ssh.socket: Bound to unit sssd.service, but unit isn't active.
Jan 07 19:38:25 ubuntu20 systemd[1]: Dependency failed for SSSD SSH Service responder socket.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-ssh.socket: Job sssd-ssh.socket/start failed with result 'dependency'.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-sudo.socket: Bound to unit sssd.service, but unit isn't active.
Jan 07 19:38:25 ubuntu20 systemd[1]: Dependency failed for SSSD Sudo Service responder socket.
Jan 07 19:38:25 ubuntu20 systemd[1]: sssd-sudo.socket: Job sssd-sudo.socket/start failed with result 'dependency'.
Jan 07 19:38:25 ubuntu20 systemd[1]: Starting Accounts Service...
似乎sudo
也因为这个原因停止了工作。我现在得到了sudo: 3 incorrect password attempts
。昨天一切都很好,我没有对系统进行任何更改或安装任何软件。
更新:
~$ systemctl status sssd
○ sssd.service - System Security Services Daemon
Loaded: loaded (/lib/systemd/system/sssd.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Tue 2025-01-07 19:38:24 EST; 30min ago
├─ ConditionPathExists=|/etc/sssd/sssd.conf was not met
└─ ConditionDirectoryNotEmpty=|/etc/sssd/conf.d was not met
Jan 07 19:38:25 ubuntu20 systemd[1]: Condition check resulted in System Security Services Daemon being skipped.
~$ systemctl start sssd
它提示我“需要身份验证”,我的密码被接受了。
~$ systemctl status sssd
○ sssd.service - System Security Services Daemon
Loaded: loaded (/lib/systemd/system/sssd.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Tue 2025-01-07 20:12:37 EST; 15min ago
├─ ConditionPathExists=|/etc/sssd/sssd.conf was not met
└─ ConditionDirectoryNotEmpty=|/etc/sssd/conf.d was not met
Jan 07 19:38:25 ubuntu20 systemd[1]: Condition check resulted in System Security Services Daemon being skipped.
Jan 07 20:12:37 ubuntu20 systemd[1]: Condition check resulted in System Security Services Daemon being skipped.
现在sudo
可以正常工作。为什么 SSSD 会干扰sudo
功能?
~$ journalctl -xeu sssd.service
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit sssd.service has finished successfully.
░░
░░ The job identifier is 199.
-- Boot 12bc6c7bf6f14ab8a277022b764c4482 --
Jan 07 19:27:30 ubuntu20 systemd[1]: Condition check resulted in System Security Services Daemon being skipped.
░░ Subject: A start job for unit sssd.service has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit sssd.service has finished successfully.
░░
░░ The job identifier is 183.
-- Boot 002196eb090942a8bf85fb57d3466b96 --
Jan 07 19:38:25 ubuntu20 systemd[1]: Condition check resulted in System Security Services Daemon being skipped.
░░ Subject: A start job for unit sssd.service has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit sssd.service has finished successfully.
░░
░░ The job identifier is 103.
Jan 07 20:12:37 ubuntu20 systemd[1]: Condition check resulted in System Security Services Daemon being skipped.
░░ Subject: A start job for unit sssd.service has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
SSSD主要用于拥有多用户、多台计算机的组织。
SSSD 允许使用 Windows Active Directory 或 LDAP(带或不带 Kerberos)集中管理用户及其密码。(AD 的核心是具有 Microsoft 架构的 LDAP 和 Kerberos 服务器)
它需要在 /etc/sssd/sssd.conf 中进行配置
https://documentation.ubuntu.com/server/how-to/sssd/with-active-directory/
sssd 依赖 libnss-sss 和 libpam-sss 集成到 NSS 和 PAM 中,参与登录、认证和授权过程。
GLIBC 使用 /etc/nsswitch.conf 中配置的 NSS 来确定 Linux 存储用户的位置。通常,用户、他们的密码和他们所属的组保存在 /etc 中的文件中,但您也可以添加其他用户管理源
PAM 提供可插入的身份验证模块,用于定义身份验证、会话和帐户的规则。这些规则可以限制可接受的密码或锁定帐户前可以尝试的登录次数。
当您调用 sudo 时,pam 和 nss 会被调用,并且在您的情况下会尝试在 ldap 中查找您的用户但失败。
这同样适用于 SSH 登录和尝试列出文件时,因为文件系统按用户 ID 和组 ID 存储文件并通过从 NSS 查找来显示名称。
简而言之,除非您拥有大量计算机和多个用户,否则通常不需要 SSSD。它一定是意外安装的,您可以将其删除。确保 /etc/nsswitch 有 passwd,shadow 和 groups 设置为文件或 compat,/etc/pam.d/ 中的规则没有阻止登录,并且 /etc/sudoers 是正确的。
或者,您可以从启动中禁用 sssd: