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 / 问题

问题[pam](server)

Martin Hope
Marty Cagas
Asked: 2022-04-08 14:16:29 +0800 CST

PAM 可以与 Postfix 和 Dovecot SASL 一起使用吗?

  • 0

我已设置Postfix以将Dovecot SASL用于PAM和 Unix 用户,并将 Dovecot LDA (LMTP) 用于本地邮箱存储。经过一些测试,原来收到的邮件被拒绝,原因是:

错误:[user] 的 passdb 查找失败:配置的 passdbs 不支持凭据查找

这既麻烦又麻烦——我选择了基于 PAM 的身份验证,因为我发现的所有消息来源都表明这是最简单、最可靠的方式。我现在很难解决问题所在 - 我不确定这是否真的是 PAM 的问题,或者我的配置是否有问题。

日志

doveadm查找测试:

$ doveadm auth lookup [user]
Error: passdb lookup failed for [user]: Configured passdbs don't support credentials lookups

查找测试后的 Dovecot 调试日志:

$ cat /var/log/dovecot/dovecot-debug.log | tail -5
[date][time] auth: Debug: master in: PASS    1       [user]  service=doveadm debug
[date][time] auth: Debug: pam([user]): Performing passdb lookup
[date][time] auth: Debug: pam([user]): passdb doesn't support credential lookups
[date][time] auth: Debug: pam([user]): Finished passdb lookup
[date][time] auth: Debug: passdb out: FAIL   1       reason=Configured passdbs don't support credentials lookups

相关配置

/etc/dovecot/conf.d/10-auth.conf文件:

auth_username_format = %Ln
auth_mechanisms = plain login
!include auth-system.conf.ext

/etc/dovecot/conf.d/auth-system.conf.ext文件:

passdb {
    driver = pam 
    args = session=yes failure_show_msg=yes dovecot
}
userdb {
    driver = static
    args = uid=vmail gid=vmail home=/var/vmail/%n
}

该/etc/pam.d/dovecot文件是 Rocky Linux(与 RHEL 相同,与 Fedora 相同)Dovecot 软件包附带的默认文件:

#%PAM-1.0
auth       required     pam_nologin.so
auth       include      password-auth
account    include      password-auth
session    include      password-auth

但是,我也尝试了Dovecot PAM 官方文档建议的配置,但没有产生任何不同的结果。我对我的其余配置很有信心,因为我花了很多时间研究这些选项,但我仍然几乎不了解 PAM 配置......

所有日志都指出问题出在 Dovecot SASL 本身,而不是 Postfix 或 Dovecot 配置。任何建议将不胜感激。

postfix dovecot pam sasl
  • 1 个回答
  • 194 Views
Martin Hope
ZDV
Asked: 2022-04-01 22:02:56 +0800 CST

使用 pam_mount 安装 Windows 共享 (cifs) 时出错

  • 0

我有一台 Ubuntu 21.10 电脑加入了 Samba AD 域控制器。一切工作正常 - Kerberos 工作(可以使用 kinit 获取票证),winbind 工作(可以获取有关用户和组的信息),我能够使用域凭据登录系统。

并且手动安装共享也可以使用 Kerberos 和 ntlmssp 授权:

sudo mount -t cifs //server/path /mount/point -o username=USER,domain=DOMAIN,sec=ntlmssp
sudo mount -t cifs //server/path /mount/point -o username=USER,domain=DOMAIN,sec=krb5

像 username=USER@DOMAIN 这样设置用户名也可以。

问题是当用户通过 gnome 登录时,我无法让 pam_mount 工作!

像这样在 pam_mount.conf.xml 中使用 krb5

<volume
      fstype="cifs"
      server="server"
      path="path"
      mountpoint="mount/point"
      options="sec=krb5"
  />

在 auth.conf 中给出错误

(mount.c:72): mount error(126): Required key not available

像这样在 pam_mount.conf.xml 中使用 ntlmssp

<volume
      fstype="cifs"
      server="server"
      path="path"
      mountpoint="mount/point"
      options="sec=ntlmssp"
  />

在 auth.conf 中给出不同的错误

(pam_mount.c:173): conv->conv(...): Conversation error 

在 pam_mount 中启用调试后,我还可以在 auth.log 中看到它正在执行的确切安装命令,并且当我手动运行它们时,它与上面的工作相同。

我尝试了以下方法:

  • 以不同的组合使用挂载选项:vers=3.0, _netdev,user,sec
  • 强制 Kerberos 使用 pam_winbind 配置将票证存储在 /tmp/krb5cc_%u 中的文件中
  • 阅读大量论坛

有任何想法吗?

ubuntu mount pam
  • 1 个回答
  • 510 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
phk
Asked: 2022-01-28 05:27:01 +0800 CST

为每个用户在下次 SSH 登录时强制执行 2FA 配置

  • 1

我找到了许多关于如何启用 2FA(TOTP,RFC 6238)的教程,但是还有一种方法可以强制 SSH 用户在第一次登录时对其进行配置吗?(我正在使用 OpenSSH 服务器)

我想我可以创建一个每次运行的脚本并检查.google_authenticator特定用户的 a 是否存在,如果不存在,则运行google-authenticator直到它存在然后编辑/etc/pam.d/sshd(呃-哦),否则运行默认的 shell/命令......但可能有很多不可预见的边缘情况和破坏 SSH 登录的可能性。

因此,在我可能重新发明轮子并且随意地这样做之前,现有的解决方案是否已经存在?

我会假设它确实如此,因为它是面向用户的软件的规范,例如 Gitlab 和 Gsuite,您可以在其中强制用户在下次登录时配置 2FA。

linux ssh pam google-authenticator two-factor-authentication
  • 1 个回答
  • 165 Views
Martin Hope
Karol
Asked: 2022-01-08 05:14:24 +0800 CST

SSH 认证:(公钥异或密码)+ google 验证码

  • 1

我正在使用 Debian 靶心。我正在尝试设置 SSH 两种类型的登录:

  1. 来自 Google Authenticator 的密码 + 代码(如果用户设置它,“nullok”选项),
  2. 来自 Google Authenticator 的公钥 + 代码(如果用户设置了它,“nullok”选项)。

类型 #1 对我有用。在类型 #2 中,我有来自 GA 的公钥 + 密码(不是公钥密码)+ 代码。我将此行添加到 /etc/ssh/sshd_config

AuthenticationMethods publickey,keyboard-interactive keyboard-interactive

如果提供了密钥,我希望用户不会被提示输入密码。准确地说,如果提供了公钥,如何绕过 pam_unix.so 需求?

有什么办法可以在一台机器上完成我想要的吗?提前致谢。

debian ssh pam google-authenticator two-factor-authentication
  • 1 个回答
  • 104 Views
Martin Hope
AlastairG
Asked: 2021-11-16 00:57:16 +0800 CST

CRON[83463]:设置用户凭据失败

  • 0

我有许多 docker 容器,它们的设置大多相同,它们成功地使用 cron 运行夜间备份作业。

我有另一个容器,设置基本相同,它尝试使用 cron 运行夜间备份作业,但失败了。

我安装了 rsyslog 以获取更多信息,当 cron 运行 root 的 crontab 时,我在 syslog 文件中看到以下条目:

CRON[83463]: Failure setting user credentials

此容器与所有其他容器之间的一个区别在于,此容器允许用户使用 LDAP 登录。它在 Dockerfile 中有以下额外的行:

RUN echo '*;*;*;Al0000-2400;svn' >> /etc/security/group.conf
COPY pam_group /usr/share/pam-configs/groups
RUN echo "session required        pam_mkhomedir.so skel=/etc/skel umask=077" >> /etc/pam.d/common-session
RUN sed -i 's#\(.*pam_ldap.so.*\)#auth    required     pam_group.so\n\1#' /etc/pam.d/common-auth
RUN sed -i 's#^passwd:.*#passwd:  files ldap systemd#;s#^group:.*#group:   files ldap systemd#;s#^shadow:.*#shadow:  files ldap#' /etc/nsswitch.conf

该pam_group文件如下所示:

Name: activate /etc/security/group.conf
Default: yes

Priority: 900
Auth-Type: Primary Auth:
        required                        pam_group.so

显然,有关设置 LDAP 并尝试确保将所有用户添加到svn组(根本不起作用)的一些事情破坏了 cron 的 root 用户会话。

我查看了整个互联网,但没有发现这个特定的错误。我已经尝试过相关的解决方案,但没有任何效果。

更新:

pam.d/common-auth 看起来像:

auth    [success=2 default=ignore]  pam_unix.so nullok_secure
auth    required     pam_group.so
auth    [success=1 default=ignore]  pam_ldap.so use_first_pass
# here's the fallback if no module succeeds
auth    requisite           pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
auth    required            pam_permit.so
# and here are more per-package modules (the "Additional" block)
auth    optional            pam_cap.so 

pam.d/cron 看起来像:

@include common-auth

# Sets the loginuid process attribute
session    required     pam_loginuid.so

# Read environment variables from pam_env's default files, /etc/environment
# and /etc/security/pam_env.conf.
session       required   pam_env.so

# In addition, read system locale information
session       required   pam_env.so envfile=/etc/default/locale

@include common-account
@include common-session-noninteractive 

# Sets up user limits, please define limits for cron tasks
# through /etc/security/limits.conf
session    required   pam_limits.so
cron ldap pam
  • 1 个回答
  • 237 Views
Martin Hope
Hamish Moffatt
Asked: 2021-08-05 23:28:59 +0800 CST

使用谷歌身份验证器的 SSH 公钥身份验证仍然要求输入密码

  • 4

我正在尝试使用 libpam-google-authenticator 通过 ssh 启用 2FA。并非所有用户都需要启用身份验证器。每个人都使用 ssh 公钥,没有人有密码。我正在运行 Debian buster,并且我还尝试了来自 Bullseye 的 libpam-google-authenticator。

我的问题是,无论我在 PAM 配置中添加什么,没有启用身份验证器的用户永远不会直接登录,而是总是要求输入密码。

我已经安装了 libpam-google-authenticator 并配置了 /etc/ssh/sshd_config :

PasswordAuthentication no
ChallengeResponseAuthentication yes
AuthenticationMethods publickey,keyboard-interactive
PasswordAuthentication no
PermitEmptyPasswords no

我无法计算出正确的 PAM 配置,因此没有 .google_authenticator 文件的用户仍然可以登录。根据我使用的内容,系统会提示用户输入密码(他们没有密码),或者没有完全允许进入。

在 /etc/pam.d/sshd 我尝试过(像这样Trying to get SSH with public key (no password) + google 身份验证器在 Ubuntu 14.04.1 上工作):

#@include common-auth
auth       required     pam_google_authenticator.so debug nullok

在这种情况下,没有验证器设置的用户会被以下调试拒绝;

Aug 05 15:11:18 <host> sshd(pam_google_authenticator)[746624]: debug: start of google_authenticator for "<user>"
Aug 05 15:11:18 <host> sshd(pam_google_authenticator)[746624]: debug: end of google_authenticator for "<user>" Result: The return value should be ignored by PAM dispatch
Aug 05 15:11:18 <host> sshd[746620]: error: PAM: Permission denied for <user> from <IP>

是否pam_permit需要设置后备案例?

我也尝试过之前和之后的各种组合,auth required但auth sufficient它们@include common-auth都会导致没有验证器的用户被要求输入密码,有时也会要求有验证器的用户输入密码。

有没有人有做这个工作的食谱?

debian pam google-authenticator two-factor
  • 2 个回答
  • 1093 Views
Martin Hope
David
Asked: 2021-07-07 05:20:21 +0800 CST

未考虑 /etc/login.defs 设置:密码老化

  • 0

以下是在 Ubuntu 20.04 系统上完成的。


这是我面临问题的场景:

  • login.defs我在文件中编辑密码时效设置
  • passwd user然后我用命令更改用户的密码
  • chage -l user我使用命令检查对用户密码应用了哪些设置

问题:

返回的值似乎没有考虑对 /etc/login.defs 文件所做的更改。

这有什么原因吗?

我该如何调试问题?(例如:如何查看哪些其他设置可能会篡改来自 的值/etc/login.defs?)

谢谢!

ubuntu login configuration debugging pam
  • 1 个回答
  • 366 Views
Martin Hope
Brian Bauman
Asked: 2021-03-05 16:42:07 +0800 CST

为 SSH 和 Samba 身份验证设置可组合 POSIX 组的最简单方法是什么?

  • 2

背景

我将我认为是相当普通的基础设施块放在一起,但遇到了很多问题,我不禁想知道是否有更简单的方法。


我需要能够执行以下操作:

  • 使用委派身份验证和基于组的权限将文件从 Linux 服务器安全地共享给 OSX、Linux 和 Windows 计算机上的数百名用户。
  • 允许基于组的 SSH 访问数十个 Linux 服务器,具有委派的身份验证和基于组的权限。
  • 能够创建由其他组和用户组成的组,最好是任意深度。
  • 能够允许基本任务的自助服务(密码更改和恢复,个人信息的有限编辑等)
  • 能够以最少的配置迁移现有服务器(运行各种 Linux 风格) - 因此尽可能坚持“标准”配置,尤其是客户端。

我希望能够选择执行以下操作:

  • 除基于密码的身份验证外,还支持公钥身份验证

对我来说,上述所有听起来都像是 LDAP + Samba 是唯一可行的方法,尤其是因为之前的实现使用了 FreeIPA/Samba。团队决定使用 OpenLDAP 和 LDAP Account Manager 来提供身份验证和目录服务,但实施过程却是一场噩梦。


OpenLDAP 设置

我的目录树具有以下结构:

 - dc=example,dc=com
   - ou=groups
     - cn=groupA
     - ...
   - ou=policies
     - cn=passwordDefault
     - ...
   - ou=services
     - cn=service1
     - ...
   - ou=users (
     - uid=user1
     - ...

用户有以下类别:

  • inetOrgPerson(结构)
  • posixAccount
  • 影子账户
  • sambaSamAccount
  • ppolicyUser
  • 密码自复位
  • ldapPublicKey
  • 一般信息

用户工作得很好。大多数 Linux 机器都使用sshd -> libpam-ldap -> libnss-ldapd -> nscd -> nslcdand coreutils -> libnss-ldapd -> nscd -> nslcd,因此getent passwd根本id [username]不需要任何特殊配置即可工作。

服务有以下类:

  • applicationProcess(结构)
  • 简单安全对象

服务只是内部服务(如 Gitlab)的简单 DN/pw 实体,可以直接联系 LDAP,这样我们就可以关闭匿名绑定而不切断它们。他们也工作得很好。(注意 - 一些服务实际上需要作为 POSIX 帐户存在,因此为简单起见将它们配置为用户)

策略是诸如密码策略之类的实体,它们不在此问题的范围内。

组一直是真正的问题,因此我将在下一节中详细讨论它们。


团体的问题

无论我做什么,我似乎都无法创建可组合的 POSIX 兼容组。在这种情况下,我使用“可组合”来表示以下内容。假设配置了这些组 - GroupA(User1、User2、User3)、GroupB(User4、User5)和 GroupC(User1、User5)。可组合组将允许创建动态 GroupD (GroupA, GroupC),有效成员资格为 (User1, User2, User3, User5)。 理想情况下,GroupD 也可以定义为 (GroupA, GroupC, User6)。此外,理想情况下,您可以继续嵌套多于一层的组。

OpenLDAP 和 LAM 有一些工具似乎适用于这类事情,但我不断遇到模式问题、设计问题、实现问题或三者的某种组合。

  • dynlist - 这个 OpenLDAP 覆盖允许您基于 LDAP 过滤器即时填充属性列表。您甚至可以拥有由用户和其他组组成的混合组!不幸的是,覆盖仅在直接查看它所附加的实体时触发。这意味着getent group [group](直接查看一个或多个组)有效,但groups [user](搜索用户在组中的存在)无效。nss这使得如果不将您自己的映射层或其他 LDAP 使用者写入,就不可能基于动态组进行 SSH 。此外,可能出于类似原因,您无法从其他 dynlist 组创建 dynlist 组。

  • memberof - 此 OpenLDAP 覆盖将自动更新memberOf用户的属性,以对应用户在组中的添加和删除。然而,它似乎需要使用基于 RFC2307 的类以外的组类posixGroup,因为它memberof需要基于 DN 的成员资格,而不是基于 uid 的成员资格。它实际上也无助于管理组本身。

  • 自动组 - 此OpenLDAP覆盖将自动从可配置属性中添加或删除用户 DN,对应于用户在可配置 LDAP 过滤器结果中的存在或不存在。这个覆盖似乎需要memberof安装,因为autogroup除非我包含olcAGmemberOfAd配置属性,否则安装会失败。它似乎也需要基于 DN 的成员资格,所以memberof它需要一个基于 RFC2307 以外的类posixGroup

我最初尝试使用 class 实现静态组posixGroup (structural),并使用附加labeledURIObject类来附加dynlist过滤器的动态组。这基本上奏效了,但我遇到了dynlist上面列出的缺点。

然后我尝试改用autogroup覆盖,但遇到了似乎需要基于 DN 的成员资格的问题。在这一点上,我觉得我必须尝试摆脱posixGroup结构类,因为似乎没有任何东西支持它。LAM似乎更喜欢使用 和 的组合groupOfNames,因为它包含一个功能,当两个属性都存在于同一个对象上时RFC2307bis-posixGroup,它可以自动member将属性与属性同步。memberUid所以我修改了posixAccountOpenLDAP 附带的模式,使其成为辅助而不是结构,并使用groupOfNames(结构)和修改的posixAccount类创建组。破解 OpenLDAP 的objectClass使用 RFC2307bis-esque 类来欺骗它的模式感觉就像 Not The Right Thing To Do™,但 OpenLDAP/LAM 似乎接受了它。这样做也使我能够memberof成功安装,这很好。

autogroup,但是,只有一半有效。虽然它会将用户添加到动态组(使用 可见groups [user]),但在将用户从基本组中删除时不会将其删除。 groupOfNames还要求其members字段始终至少有一个用户在其中,这对于与autogroup. 您必须使用初始设置它,但是一旦锁定属性member就无法删除虚拟成员。autogroupmember


配置

cn=模块{0},cn=配置

dn: cn=module{0}
objectClass: olcModuleList
cn: module{0}
olcModulePath: /usr/lib/ldap
olcModuleLoad: {0}back_mdb
olcModuleLoad: {1}ppolicy
olcModuleLoad: {2}autogroup
olcModuleLoad: {3}memberof

olcOverlay={1}memberof,olcDatabase={1}mdb,cn=config

dn: olcOverlay={1}memberof
objectClass: top
objectClass: olcConfig
objectClass: olcOverlayConfig
objectClass: olcMemberOf
olcOverlay: {1}memberof
olcMemberOfDangling: ignore
olcMemberOfRefInt: TRUE
olcMemberOfGroupOC: groupOfNames
olcMemberOfMemberAD: member
olcMemberOfMemberOfAD: memberOf

olcOverlay{2}autogroup,olcDatabase={1}mdb,cn=config

olcOverlay: {2}autogroup
structuralObjectClass: olcAutomaticGroups
olcAGattrSet: {0}labeledURIObject labeledURI member
olcAGmemberOfAd: memberOf

问题

最具体到最少:

  1. 为什么autogroup能够将用户添加到动态组,但不能删除它们?
  2. 有没有更简单的方法来实现这个用例?
  3. 我是否使用了错误的工具来完成这项工作?使用不同的 LDAP 实现、一些简单的客户端配置或完全非 LDAP 的东西,这个用例会更容易吗?
ldap openldap pam nss
  • 1 个回答
  • 509 Views
Martin Hope
Curtis
Asked: 2020-09-23 21:34:46 +0800 CST

Google Compute - CentOS 8 PAM 认证在更新后失败

  • 1

我有一个无法访问 CentOS 8 虚拟机的 Google Cloud 项目。它在 x86_64 上运行内核版本 4.18.0-193.19.1.el8_2.x86_64。我也在启用 selinux 的情况下运行。

昨天在我的 CentOS 8 虚拟机上运行之前sudo yum update,我能够通过 OTP 进行 SSH 和身份验证而没有问题。今天,我所有的 OTP 代码都失败了。我不确定更新是问题的原因,但这是我在此问题浮出水面之前所做的唯一重大更改。

我尝试在手机的 Google Authenticator 应用程序上重新同步,但没有帮助。此外,我已经尝试了在运行时创建的每个紧急临时代码google-authenticator,但也没有一个有效。据我所知,客户端和服务器之间的时间足够同步。

作为对此的回应,我启用了串行控制台访问,但是,我记得从来没有为我的 CentOS 用户设置密码——只是 SSH 密钥。因此,我无法通过串行控制台进行身份验证,也无法通过 SSH 进行身份验证。

还有什么我可以尝试的吗?

pam google-compute-engine centos8
  • 1 个回答
  • 224 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