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 / 问题 / 1083571
Accepted
AlastairG
AlastairG
Asked: 2021-11-16 00:57:16 +0800 CST2021-11-16 00:57:16 +0800 CST 2021-11-16 00:57:16 +0800 CST

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

  • 772

我有许多 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 1 个回答
  • 237 Views

1 个回答

  • Voted
  1. Best Answer
    András Korn
    2022-02-26T09:34:08+08:002022-02-26T09:34:08+08:00

    您的问题可能是 root 用户不在 LDAP 中;你需要以某种方式包括pam_unix.so在内/etc/pam.d/cron。

    例如:

    auth    [success=2 default=ignore]      pam_unix.so nullok_secure
    @include common-auth
    

    假设common-auth开始是这样的:

    auth    [success=1 default=ignore]      pam_ldap.so
    auth    requisite                       pam_deny.so
    auth    required                        pam_permit.so
    
    • 1

相关问题

  • 每 4 小时运行一次 cron 的正确语法是什么?[复制]

  • 用于 mysql 数据库清理和备份的 crontab

  • Windows cron 作业

  • 使用 crontab 和 /etc/cron.hourly,daily,weekly 的区别

  • crontab ifconfig 什么都不输出

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