zoukankan      html  css  js  c++  java
  • 错误:you (root) are not allowed to access to (crontab) because of pam configuration.

    linux crontab报以下错误解决

    [root@china ~]# crontab -l

    拒绝权限
    You (root) are not allowed to access to (crontab) because of pam configuration.

    解决:

    1.查看定时任务的日志/var/log/cron

    pam_access(crond:account): access denied for user `root' from `cron'

    2. 查看 /etc/pam.d/crond

    root>more /etc/pam.d/crond
    
    #
    # The PAM configuration file for the cron daemon
    #
    #
    # No PAM authentication called, auth modules not needed
    account    required   pam_access.so
    account    include    password-auth
    session    required   pam_loginuid.so
    session    include    password-auth
    auth       include    password-auth

    修改文件:

    [root@~]# cp /etc/pam.d/crond /etc/pam.d/crond.bak
    [root@ ~]# vim /etc/pam.d/crond

    account    sufficient   pam_access.so
    account    include    system-auth
    session    sufficient   pam_loginuid.so
    session    include    system-auth
    auth       sufficient pam_rootok.so
    auth       required   pam_env.so
    auth       include    system-auth

    重启crond 

    [root@~]# /etc/init.d/crond restart
    停止 crond: [确定]
    正在启动 crond: [确定]

    重新登录root

    [root@~]# crontab -e

     完美解决

  • 相关阅读:
    具有快表的地址变换机构
    npm更换淘宝镜像
    内存扩充技术
    内存管理的概念
    内存的基础知识
    102. 二叉树的层序遍历
    104. 二叉树的最大深度
    206. 反转链表
    mysql 多字段查询,全局搜素
    java 处理html转义字符
  • 原文地址:https://www.cnblogs.com/xiao-apple36/p/14455157.html
Copyright © 2011-2022 走看看