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
    • 最新
    • 标签
主页 / unix / 问题 / 451343
Accepted
Govna
Govna
Asked: 2018-06-23 08:26:53 +0800 CST2018-06-23 08:26:53 +0800 CST 2018-06-23 08:26:53 +0800 CST

(root) 使用 PAM 授权用户失败(权限被拒绝)

  • 772

在跟踪 /var/log/cron 时,我注意到 cron 作业由于 PAM 权限而失败。在我的 access.conf 中,我确实有以下未注释的内容,以确保(或我认为确保)root 确实有权运行 cron 作业。

# User "root" should be allowed to get access via cron .. tty5 tty6.
+ : root : cron crond :0 tty1 tty2 tty3 tty4 tty5 tty6

我在 Centos 7 Kernel 3.10.0-693.21.1.el7.x86_64 上,我们已经通过领域、sssd、kerberos 将它连接到我们的 Windows 活动目录实例。我的安装步骤可以在这里找到Best Auth Mech to Connect to Windows AD

我现在不知所措,无法弄清楚可能是什么原因造成的。我仔细检查了root密码没有过期,也没有过期。当前的 root 访问权限是通过 windows 安全组配置的。

任何帮助将不胜感激!

编辑 我在 pam_access.so 的末尾添加了调试并得到以下信息

crond[17411]: pam_access(crond:account): login_access: user=root, from=cron, file=/etc/security/access.conf crond[17411]: pam_access(crond:account): line 60: - : ALL EXCEPT wheel shutdown sync : LOCAL root crond[17411]: pam_access(crond:account): list_match: list=ALL EXCEPT wheel shutdown sync, item=root crond[17411]: pam_access(crond:account): user_match: tok=ALL, item=root crond[17411]: pam_access(crond:account): string_match: tok=ALL, item=root crond[17411]: pam_access(crond:account): user_match: tok=wheel, item=root crond[17411]: pam_access(crond:account): string_match: tok=wheel, item=root crond[17411]: pam_access(crond:account): user_match: tok=shutdown, item=root crond[17411]: pam_access(crond:account): string_match: tok=shutdown, item=root crond[17411]: pam_access(crond:account): user_match: tok=sync, item=root crond[17411]: pam_access(crond:account): string_match: tok=sync, item=root crond[17411]: pam_access(crond:account): user_match=1, "root" crond[17411]: pam_access(crond:account): list_match: list=LOCAL root, item=root crond[17411]: pam_access(crond:account): from_match: tok=LOCAL, item=cron crond[17411]: pam_access(crond:account): string_match: tok=LOCAL, item=cron crond[17411]: pam_access(crond:account): from_match=1, "cron" crond[17411]: pam_access(crond:account): access denied for user根'来自'cron'

cron root
  • 2 2 个回答
  • 12998 Views

2 个回答

  • Voted
  1. Best Answer
    Govna
    2018-06-26T05:34:53+08:002018-06-26T05:34:53+08:00

    我最终将我的 access.conf 重新排列到下面。从某种意义上说,我将 cron 条目作为配置文件中的第二个条目,这似乎正确设置了 root 访问 cron 的权限。

     #
     # Disallow non-root logins on tty1
     #
     #-:ALL EXCEPT root:tty1
     #
     # User "root" should be allowed to get access via cron .. tty5 tty6.
     + : root : cron crond :0 tty1 tty2 tty3 tty4 tty5 tty6
     #
     # Disallow console logins to all but a few accounts.
     #
     -:ALL EXCEPT wheel shutdown sync:LOCAL root
    

    如果有人知道,但我怀疑权限是建立在它们在配置中的输入方式上的。即使您通过配置中的条目获得许可,如果该条目之前的一行拒绝您访问,它会覆盖授予条目,因为它首先出现?

    • 1
  2. YoMismo
    2018-06-26T05:18:09+08:002018-06-26T05:18:09+08:00

    如下一行所示:

    crond[17411]: pam_access(crond:account): access denied for user root' from cron'

    看起来是 cron 拒绝访问。检查您的系统中是否有cron.alloworcron.deny文件,通常在您的 /etcor/etc/cron.d目录中。如果您有一个cron.allow文件,您需要在其中添加您的用户,如果您有一个cron.deny文件并且那里列出了根目录,则您需要将其删除。

    • 0

相关问题

  • Cron 作业未按预期工作

  • Cron */6 小时但有偏移量?

  • 如何恢复已删除的 crontab

  • 从 /etc/passwd 文件中删除了我的 root 帐户,以便在 Centos7.3 中进行测试

  • Auto-SSH 手动工作,但不在后台工作

Sidebar

Stats

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

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    ssh 无法协商:“找不到匹配的密码”,正在拒绝 cbc

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    如何卸载内核模块“nvidia-drm”?

    • 13 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add 返回:“连接代理时出错:没有这样的文件或目录” 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve