AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[sssd](server)

Martin Hope
YuvGM
Asked: 2022-02-16 01:31:23 +0800 CST

在 ipa ubuntu 客户端上未更新 Kerberos 凭据

  • 0

当我使用 ssh 登录我的 freeipa 客户端时,我获得了 Kerberos 凭据(klist)。但是,在它们过期后,我不再获得凭据(klist 为空)。这导致没有主目录,因为用户没有 nfs 的权限。我可以使用 kinit 来获取新的凭据。重新启动 sssd 并再次使用 ssh 登录,也获得了新的票证。使用 sudo 也可以获得票证。

我什至不知道哪个进程负责请求票证,所以我不知道从哪里开始调试问题。我有 Ubuntu 20.04 并使用 freeipa-client 包安装客户端。

任何帮助,将不胜感激。

ubuntu kerberos freeipa sssd
  • 1 个回答
  • 208 Views
Martin Hope
Fred
Asked: 2022-01-29 07:49:28 +0800 CST

LDAP 找到用户,但登录时“权限被拒绝”

  • 1

我正在 Red Hat 8 中设置 LDAP 客户端。

设置配置文件后,我做了一个 LDAP 用户测试,它成功返回:

# id myusername
uid=666(myusername) gid=510(active_users) groups=510(active_users)

如果我运行ldapsearch它,它会成功返回预期的结果:

# ldapsearch -x -ZZ -h ldap.example.com -b dc=example,dc=com

但是,如果我尝试ssh从另一台机器访问 Red Hat 8 机器,则会收到以下错误:

# ssh [email protected]
[email protected]'s password:
Permission denied, please try again.

我用不同的用户帐户尝试了几台不同的机器,并得到了相同的结果。

这是我的设置:

/etc/sssd/sssd.conf

[domain/default]
ldap_tls_reqcert = demand
cache_credentials = False
ldap_search_base = dc=example,dc=com
id_provider = ldap
auth_provider = ldap
chpass_provider = ldap
ldap_uri = ldaps://ldap.example.com/
ldap_id_use_start_tls = False
ldap_tls_cacert = /etc/sssd/ca-bundle.crt

[sssd]
config_file_version = 2
services = nss, pam, ssh
domains = default

[nss]
homedir_substring = /home

/etc/openldap/ldap.conf

TLS_CACERT /etc/sssd/ca-bundle.crt

#BASE dc=example,dc=com
#URI ldap://ldap.example.com/
SASL_NOCANON    on
URI ldaps://ldap.example.com/
BASE dc=example,dc=com
TLS_CACERTDIR /etc/sssd

/etc/nsswitch.conf

# Generated by authselect on Thu Jan 27 15:22:08 2022
# Do not modify this file manually.

passwd:     sss files systemd
group:      sss files systemd
netgroup:   sss files
automount:  sss files
services:   sss files

# passwd:    db files
# shadow:    db files
# group:     db files

# In order of likelihood of use to accelerate lookup.
shadow:     files sss
hosts:      files dns myhostname

aliases:    files
ethers:     files
gshadow:    files
# Allow initgroups to default to the setting for group.
# initgroups: files
networks:   files dns
protocols:  files
publickey:  files
rpc:        files

/etc/sysconfig/authconfig

USELDAP=yes
USELDAPAUTH=yes

/etc/pam.d/password-auth

# Generated by authselect on Thu Jan 27 15:22:08 2022
# Do not modify this file manually.

auth        required                                     pam_env.so
auth        required                                     pam_faildelay.so delay=2000000
auth        [default=1 ignore=ignore success=ok]         pam_usertype.so isregular
auth        [default=1 ignore=ignore success=ok]         pam_localuser.so
auth        sufficient                                   pam_unix.so nullok
auth        [default=1 ignore=ignore success=ok]         pam_usertype.so isregular
auth        sufficient                                   pam_sss.so forward_pass
auth        required                                     pam_deny.so

account     required                                     pam_unix.so
account     sufficient                                   pam_localuser.so
account     sufficient                                   pam_usertype.so issystem
account     [default=bad success=ok user_unknown=ignore] pam_sss.so
account     required                                     pam_permit.so

password    requisite                                    pam_pwquality.so local_users_only
password    sufficient                                   pam_unix.so sha512 shadow nullok use_authtok
password    sufficient                                   pam_sss.so use_authtok
password    required                                     pam_deny.so

session     optional                                     pam_keyinit.so revoke
session     required                                     pam_limits.so
-session    optional                                     pam_systemd.so
session     [success=1 default=ignore]                   pam_succeed_if.so service in crond quiet use_uid
session     required                                     pam_unix.so
session     optional                                     pam_sss.so

/etc/pam.d/system-auth

# Generated by authselect on Thu Jan 27 15:22:08 2022
# Do not modify this file manually.

auth        required                                     pam_env.so
auth        required                                     pam_faildelay.so delay=2000000
auth        [default=1 ignore=ignore success=ok]         pam_usertype.so isregular
auth        [default=1 ignore=ignore success=ok]         pam_localuser.so
auth        sufficient                                   pam_unix.so nullok
auth        [default=1 ignore=ignore success=ok]         pam_usertype.so isregular
auth        sufficient                                   pam_sss.so forward_pass
auth        required                                     pam_deny.so

account     required                                     pam_unix.so
account     sufficient                                   pam_localuser.so
account     sufficient                                   pam_usertype.so issystem
account     [default=bad success=ok user_unknown=ignore] pam_sss.so
account     required                                     pam_permit.so

password    requisite                                    pam_pwquality.so local_users_only
password    sufficient                                   pam_unix.so sha512 shadow nullok use_authtok
password    sufficient                                   pam_sss.so use_authtok
password    required                                     pam_deny.so

session     optional                                     pam_keyinit.so revoke
session     required                                     pam_limits.so
-session    optional                                     pam_systemd.so
session     [success=1 default=ignore]                   pam_succeed_if.so service in crond quiet use_uid
session     required                                     pam_unix.so
session     optional                                     pam_sss.so

/etc/ssh/sshd_config

# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

# Logging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:
PermitRootLogin yes
AuthorizedKeysFile .ssh/authorized_keys

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no

# GSSAPI options
GSSAPIAuthentication yes
GSSAPICleanupCredentials no
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
#GSSAPIEnablek5users no

UsePAM yes

X11Forwarding yes

# It is recommended to use pam_motd in /etc/pam.d/sshd instead of PrintMotd,
# as it is more configurable and versatile than the built-in version.
PrintMotd no

ClientAliveInterval 600
ClientAliveCountMax 0

# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS

# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server

/var/log/安全

Jan 28 08:35:39 opal sshd[206875]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxx.xxx.xxx.xxx  user=myusername
Jan 28 08:35:40 opal sshd[206875]: Failed password for myusername from xxx.xxx.xxx.xxx port 60384 ssh2

尝试

我尝试了以下方法:

  • 在中禁用 selinux/etc/selinux/config
  • 停止 iptables.service
  • 添加PermitRootLogin yes和UsePAM yes到 Red Hat 8/etc/ssh/sshd_conf文件
  • 反复尝试authselect select sssd,然后重启sssd.service
  • 加入FORCELEGACY=yes_/etc/sysconfig/authconfig

问题

谁能帮我弄清楚为什么用户不能使用 SSH 登录到这个服务器?

redhat openldap pam sssd
  • 1 个回答
  • 353 Views
Martin Hope
Iggy
Asked: 2021-12-21 02:36:23 +0800 CST

每个 LDAP 用户使用 LDAP 和 sssd (Centos7) 给出“权限被拒绝”

  • 1

我正在尝试将 LDAP 登录限制为“admin”组。

这是我的 /etc/sssd/sssd.conf 文件:

[domain/default]
autofs_provider = ldap
ldap_tls_reqcert = allow
auth_provider = ldap
ldap_id_use_start_tls = False
chpass_provider = ldap
cache_credentials = True
debug_timestamps = True
ldap_default_authtok_type = password
ldap_search_base = dc=example,dc=com
id_provider = ldap
ldap_default_bind_dn = cn=moderator,ou=moderators,ou=test,o=organization,dc=example,DC=COM
min_id = 100
ldap_uri = ldaps://example.com:636/
ldap_default_authtok = Pa$$word
ldap_tls_cacertdir = /etc/openldap/cacerts/
ldap_tls_cert = /etc/openldap/cacerts/certificate.pem
access_provider = ldap
ldap_access_filter = memberOf=cn=admin,ou=group,o=organization,dc=example,dc=com

[sssd]
services = nss, pam, autofs
domains = default
[nss]
homedir_substring = /home

[pam]

[sudo]

[autofs]

[ssh]

[pac]

[ifp]

[secrets]

[session_recording]

我已经尝试过id username,它提出了:

id user uid=90514(user) gid=20000(users) groups=20000(users),2480(admin)

当尝试通过这样做来更改用户时,输入密码后su user会出错su: Permission denied。从 sssd.conf 中删除组限制条目时,它按预期工作并允许用户登录。

有什么想法我搞砸了吗?

编辑:现在我将使用/etc/security 和 PAM进行设置,这样就可以了。但是我仍然对使用 sssd 进行操作感到好奇。

ldap openldap centos7 sssd
  • 3 个回答
  • 1229 Views
Martin Hope
loris
Asked: 2021-11-03 06:01:16 +0800 CST

是否可以在复制树的顶部覆盖本地 LDAP 属性?

  • 0

中央 LDAP 服务器将用户数据提供为posixAccount,其中属性homeDirectory和loginShell为空。我希望允许此中央 LDAP 服务器中的用户访问 Linux 系统。

如果我使用syncrepl将数据复制到本地 LDAP 服务器,我可以使用sssd设置homeDirectory. 我也可以sssd用来将每个人的设置 loginShell为/usr/bin/bash.

但是,我希望能够loginShell在每个用户的基础上进行设置,主要是允许将 shell 设置为/sbin/nologin以将单个用户锁定在系统之外。

是否可以通过这种方式将复制的数据与本地数据结合起来?如果是这样,怎么做?

login authentication ldap sssd
  • 1 个回答
  • 34 Views
Martin Hope
Ashley Hill
Asked: 2021-10-27 09:32:23 +0800 CST

Ubuntu 20.04(sssd)上的 idmap 范围与 CentOS 7 winbind idmap 不匹配(有点)

  • 0

与我的 CentOS ID 相比,我在 Ubuntu 系统中的 Active Directory 映射非常长。最后 4 位数字匹配,但 Ubunutu 似乎在开头添加了更多内容。

在 CentOS winbind/samba 中,我使用了一个范围来获取我需要的 ID:

    idmap config * : range = 10000-20000
    idmap config * : backend = tdb
    idmap config MYDOMAIN : default = yes
    idmap config MYDOMAIN : range = 10000-24999999
    idmap config MYDOMAIN : backend = rid

这将在 Centos 上产生类似 1 1695的 ID

Ubuntu 20.04 生成 155880 1695的 guid/uid ,它添加了 155880 并从 11695 中删除了前导 1。

如何格式化 Ubuntu 的 sssd 配置以提供我需要的东西。我所有的文件和文件夹都标有 Centos ID,而 CentOS 无法识别这些较长的 ID?

我希望我解释得很好。

谢谢 :)

active-directory authentication user-management ubuntu-20.04 sssd
  • 1 个回答
  • 585 Views
Martin Hope
AAABL
Asked: 2021-10-23 14:18:56 +0800 CST

子/子 AD 域的 Ubuntu SSSD 身份验证错误

  • 0

需要帮助验证加入子域的 linux (Ubuntu) 服务器。我可以在域控制器上看到服务器名称,并且能够成功运行身份验证测试,但是我无法使用我的域帐户登录。似乎 SSSD 或 KRB5 配置的某个配置设置需要指定子域。这也不是域信任问题,因为加入子域的 Windows 服务器正在接受来自父帐户的凭据。

kinit -V [email protected]
Authenticated to Kerberos v5

root@SERVER:/var/log/sssd# systemctl status sssd

Oct 22 17:55:09 SERVER [sssd[ldap_child[27928]: Failed to initialize credentials using keytab [MEMORY:/etc/krb5.keytab]: Client '[email protected]' not found in Kerberos database. Unable to create GSSAPI-encrypted LDAP connection.

SSSD 日志文件中的错误

Fri Oct 22 17:32:51 2021) [sssd[be[DOMAIN.SYS]]] [confdb_get_domain_internal] (0x0010): Unknown domain [CHILD.DOMAIN.SYS]
(Fri Oct 22 17:32:51 2021) [sssd[be[DOMAIN.SYS]]] [confdb_get_domains] (0x0010): Error (2 [No such file or directory]) retrieving domain [CHILD.DOMAIN.SYS], skipping!

固态硬盘配置

root@SERVER:cat /etc/sssd/sssd.conf
[sssd]
services = nss, pam
config_file_version = 2
domains = DOMAIN.SYS, CHILD.DOMAIN.SYS

[nss]
default_shell = /bin/bash

[domain/DOMAIN.SYS]
id_provider = ad
access_provider = ad
override_homedir = /home/%d/%u

ad_hostname = server.child.domain.sys
#ad_server = dc.child.domain.sys
#ad_domain = DOMAIN.SYS

KRB5 配置

root@SERVER: cat /etc/krb5.conf
[libdefaults]
        default_realm = DOMAIN.SYS
        ticket_lifetime = 24h #
        renew_lifetime = 7d
        rdns = false

The following krb5.conf variables are only for MIT Kerberos.
        kdc_timesync = 1
        ccache_type = 4
        forwardable = true
        proxiable = true
ubuntu active-directory authentication kerberos sssd
  • 1 个回答
  • 1043 Views
Martin Hope
Will Dennis
Asked: 2021-07-21 16:57:25 +0800 CST

Linux:从 NIS 转换为 AD 身份验证,如何将旧 UID/GID 关联到“新”用户?

  • 1

背景:我们的组织使用 NIS 进行 UNIX/Linux 身份验证已有 20 多年的历史,一直持续到现在。大约 16 年前的某个时候,Windows 和 Active Directory 出现在我们的组织中,但 AD 从未用于 Linux 身份验证(现在只使用 RHEL/CentOS 和 Ubuntu Linux,所有其他 *nix 都被搁置了。)所以,在在我们所有的许多 Linux 资源中,我们仍然使用传统的 UID/GID 范围来存储用户文件。

现在,管理层终于决定我们需要迁移到 AD 进行 Linux 身份验证,并停止使用 NIS(那里没有真正的争论;),所以我们正在努力利用 SSSD 来做到这一点(这似乎是流行的 [仅?]将 Linux auth 与 AD 集成的方法。)我们面临的问题是如何将用户的旧的基于 NIS 的 UID 和 GID 值关联到他们新的基于 AD 的身份。例如,我在测试系统上的 AD 身份验证用户具有以下来源getent passwd -s sss wdennis:

root@vm01:~# getent passwd -s sss wdennis
wdennis:*:140001116:140000513:Will Dennis:/home/wdennis:/bin/bash

所以显然 UID/GID 是自动生成的,与我们当前的 NIS 值不对应。在对 AD 及其架构进行一些研究时,我发现用户属性包括以下内容:

  • uidNumber
  • gidNumber
  • unixHomeDirectory
  • loginShell

我的问题是,SSSD(或我们用于身份验证的任何东西)能否以某种方式消耗文件的现有 UID/GID 的值uidNumber并将gidNumber其映射到新的 AD 身份验证用户?或者,我们还能如何将现有的文件所有权信息与经过 AD 授权的用户相关联?(由于文件的数量和拥有它们的机器的数量,实际上不可能chown将文件添加到新的 UID/GID 值......)

active-directory sssd uid
  • 1 个回答
  • 352 Views
Martin Hope
JellyTea
Asked: 2021-07-21 05:22:56 +0800 CST

NSS 响应者未使内存缓存失效

  • 3

我正在删除一个用户。

# userdel u1
The memcache was not invalidated by nss responder.

但最终用户被删除。"The memcache was not invalidated by nss responder" 是什么意思?

软呢帽 34

谢谢

user-management memcached sssd nss
  • 1 个回答
  • 1273 Views
Martin Hope
S4rg0n
Asked: 2021-03-11 02:14:09 +0800 CST

pam_sss(crond:session):对 sssd 的请求失败。公共套接字的所有权或权限错误

  • 0

我们在 CENTOS 7.5 上使用 SSSD 进行 Active Directory 身份验证

从今天开始,用户将无法登录。当他们尝试时,他们会得到:

/usr/bin/id: cannot find name for group ID xxxxxxxxxx

我查看了/var/log/secure:

pam_sss(crond:session): Request to sssd failed. Public socket has wrong ownership or permissions.

这是 sssd.conf:

domains = xxxxxxxxx
config_file_version = 2
services = nss, pam

[domain/xxxxxxxx]
ad_domain = xxxxxxxx
krb5_realm = XXXXXXXXXX
realmd_tags = manages-system joined-with-samba
cache_credentials = True
id_provider = ad
krb5_store_password_if_offline = True
default_shell = /bin/bash
ldap_id_mapping = True
#use_fully_qualified_names = True
use_fully_qualified_names = False
#fallback_homedir = /home/%u@%d
fallback_homedir = /home/%u
access_provider = ad

在另一台机器上,配置完全相同,一切正常。

最近一点变化都没有。

谢谢你的帮助。

centos sssd
  • 1 个回答
  • 1872 Views
Martin Hope
Jos
Asked: 2021-02-23 13:20:46 +0800 CST

SSSD 与 Ldap 集成错误“无法启动 TLS 加密。TLS:主机名与对等证书中的 CN 不匹配'

  • 0

我们目前在 SAN 中使用通配符证书。当我在 openldap 配置中添加TLS_REQSAN 允许时,我可以从我的客户端计算机成功运行 ldapsearch 。

现在我正在尝试将 SSSD 与安全 LDAP 集成,但出现以下错误

'无法启动 TLS 加密。TLS:主机名与对等证书中的 CN 不匹配'

如何强制 SSSD 检查主题备用名称 (SAN) 而不是 CN。

是否有我可以在 SSSD 配置中设置的属性。

ldap ssl openldap sssd
  • 1 个回答
  • 2789 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve