2

I've got two machines: Fedora and CentOS. And a cronjob

0-59 * * * * env > /home/me/env.log

On CentOS I can see that /etc/environment is affecting the output while on Fedora it does not. I want Fedora to be like CentOS. What do I need to make it happen?

/etc/pam.d/crond on Fedora

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

/etc/pam.d/crond on CentOS

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

/etc/security/pam_env.conf is the same on both systems and consists of commented out lines. Even if I make /etc/pam.d/cron.d files the same, problem still persists.

1 Answer 1

0

Try changing the type of pam_env to session -- crond skips authentication, because it can just use setuid().

Also check whether /etc/pam.d/system-auth is the same.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .