You (oracle) are not allowed to access to (crontab) becaus of pam configuration.

问题描述

现场同事反馈磁盘撑爆,分析发下归档和rman备份目录空间占用最多。

分析过程

oracle用户下查看计划任务时,报错如下:

--查看计划任务
[oracle@crm-ethanDB ~]$ crontab -l
You (oracle) are not allowed to access to (crontab) because of pam configuration.

先前使用过crontab命令配置定期删除归档和rman定时备份的任务,问了下运维同事,最近也没有任何改动。

按照常规流程排查下,顺序如下:

1)查看/bin/crontab的SSID位是否标记S

2)检查/etc/cron* 是否设置了.deny文件限制;

3)检查PAM模块,cat /etc/pam.d/crond,文件中配置是否正常

4)查看系统日志cat /var/log/secure的错误信息

5)查看oracle用户密码过期

查看/bin/crontab的SSID位是否标记S

[root@crm-sbldbdg ~]# ll /bin/crontab
-rwsr-xr-x. 1 root root 57664 Oct 16  2017 /bin/crontab

检查/etc/cron 是否设置了.deny文件限制*

[root@crm-sbldbdg ~]# ll -dl /etc/cron*
drwxr-xr-x. 2 root root 4096 Jan 13  2020 /etc/cron.d
drwxr-xr-x. 2 root root 4096 Jan 13  2020 /etc/cron.daily
-rw-------. 1 root root    0 Oct 16  2017 /etc/cron.deny
drwxr-xr-x. 2 root root 4096 Jan 13  2020 /etc/cron.hourly
drwxr-xr-x. 2 root root 4096 Dec 28  2013 /etc/cron.monthly
-rw-r--r--. 1 root root  451 Dec 28  2013 /etc/crontab
drwxr-xr-x. 2 root root 4096 Dec 28  2013 /etc/cron.weekly

有/etc/cron.deny文件,但没有实际内容,也就不存在什么限制。

注意:

如果存在cron.allow文件,以cron.allow文件优先;如果cron.allow和cron.deny都存在,以cron.allow文件优先;如果只有cron.deny 文件,只能以cron.deny 文件为准。

检查PAM模块,cat /etc/pam.d/crond,文件中配置是否正常

[root@crm-sbldbdg ~]# cat /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

查看系统日志cat /var/log/secure的错误信息

Mar 3 16:54:01 crm-ethanDB crond[103891]: pam_unix(crond:account): expired password for user oracle (password aged)
Mar 3 16:54:25 crm-ethanDB su: pam_unix(su-l:session): session opened for user root by root2(uid=1001)
Mar 3 16:55:47 crm-ethanDB crontab: pam_unix(crond:account): expired password for user oracle (password aged)

Chage命令查看oracle用户密码有效期

--查看oracle用户密码有效期
[root@crm-sbldbdg ~]# chage -l oracle
Last password change : Aug 31, 2020
Password expires : Feb 27, 2023
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 90
Number of days of warning before password expires : 7

Password expires : Feb 27, 2023部分,显示oracle的密码到期时间为Feb 27, 2023。

问题原因

oracle账号密码到期,导致oracle下的crontab的定时任务不能正常进行,所以产生如下报错:

[oracle@crm-ethanDB ~]$ crontab -l
You (oracle) are not allowed to access to (crontab) because of pam configuration.

解决办法

修改oracle密码永不过期

--修改oracle密码永不过期
[root@crm-sbldbdg ~]# chage -M 99999 oracle

--chage -l oracle查看命令,再看密码过期时间为never
[root@crm-sbldbdg ~]# chage -l oracle
Last password change : Aug 31, 2020
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 10
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7Minimum number of days between password change : 10
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7

经再次验证,oracle下的crontab命令可以正常编辑。

参考链接:排故篇 | You (oracle) are not allowed to access to (crontab) because of pam configuration-CSDN博客

  • 8
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
回答: 当你遇到"You are not allowed to push code to this project"的错误提示时,可能有几个原因。首先,你需要确保你具有操作该项目的权限。你可以检查你的git账号是否有该项目的操作权限。如果没有权限,你需要联系管理员为你添加相应的权限。其次,你可以检查你的git凭证是否正确。你可以进入"控制面板" -> "用户帐户" -> "管理您的凭证" -> "Windows凭据 / 普通凭据",查看是否存在多个git凭证。你可以编辑查看你所push的网址的凭证,确保用户名和密码是正确的。另外,你也可以尝试在控制面板的凭据管理器中删除对应配置好的git网址,然后重新push时输入正确的用户名和密码。最后,如果你是在企业开发中使用git,有时候可能是因为没有得到管理员为你添加开发者权限导致无法上传。总结起来,如果遇到"You are not allowed to push code to this project"的错误提示,请冷静分析可能的原因,包括用户名/邮箱/密码是否正确,是否有权限操作该项目等。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [git 报错 You are not allowed to push code to this project 的解决办法](https://blog.csdn.net/qq_41810415/article/details/125718684)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [git push代码提示没有权限remote: You are not allowed to push code to this project.](https://blog.csdn.net/weixin_41908066/article/details/116459427)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [git push 没有权限:remote: You are not allowed to push code to this project.](https://blog.csdn.net/qiuqiudongdong/article/details/118018376)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

董小姐yyds

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值