환경
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
문제
- The cron job wasn't executed successfully, and got these messages:
Jul 10 00:31:01 hostname1 crond[2860]: CRON (xxx) ERROR: failed to open PAM security session: Success
Jul 10 00:31:01 hostname1 crond[2860]: CRON (xxx) ERROR: cannot set security context
How to let the cron job continue to run?
Cron stop after user password expired.
해결
By default, the crond service will be failed to run if the user's password has expired.
There are error message in the
/var/log/cron
file.
For example:
# tailf /var/log/cron
...
Jul 10 00:31:01 hostname1 crond[2860]: Authentication token is no longer valid; new one required
Jul 10 00:31:01 hostname1 crond[2860]: CRON (xxx) ERROR: failed to open PAM security session: Success
Jul 10 00:31:01 hostname1 crond[2860]: CRON (xxx) ERROR: cannot set security context
Actually, the
pam_unix.so
refuses the crond service to continue to run when the user's password has expired.To run cron job all time, modify the
/etc/pam.d/system-auth
file in order to skip thepam_unix.so
authentication.Modify the
/etc/pam.d/system-auth
account section like following:
account required pam_access.so
account [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
Note: In RHEL6, modify the /etc/pam.d/password-auth
instead.
- Then the pam authentication for
crond
service will pass.
'OS' 카테고리의 다른 글
[RHEL] Linux / Unix: disown Command Examples (0) | 2015.05.21 |
---|---|
[OS] NTP - DST (섬머타임제) (0) | 2015.03.16 |
[RHEL] Configuration of HugePages for Oracle database 11.2.0.3 on Oracle Linux 6.4 (0) | 2014.05.29 |
[OS] rm에 대한 이해 (0) | 2014.05.28 |
[OS] 디렉토리 권한이 777이면 다른 사용자의 파일을 삭제할 수 있다? (0) | 2014.05.28 |
[OS] Permissions (0) | 2014.05.28 |
[OS] syslog (0) | 2014.04.17 |
/etc/shadow 파일에서 !와 !!, * 차이 (0) | 2014.04.02 |
[OS] What is NUMA? (0) | 2014.03.14 |
Selecting the MMU Virtualization Mode (0) | 2014.03.07 |