2

Almost 3 weeks that, in my downtime, I try to find out where the files cron.allow & cron.deny are located in debian7 distro. No way, it seems that by default they are not in the system.

'Just' for hardening purposes, I would have those files available in my system. My question is actually if I can just touch them and use them without have to make other configurations.

root@asw-deb:~# touch /etc/cron.allow
root@asw-deb:~# touch /etc/cron.deny

Or if I may have to 'map' those files, maybee editing some cron configuration files, 'saying' where cron can find the two files I created.

Sorry if I sound a little nooby.

3

From the manual man 1 crontab:

If the /etc/cron.allow file exists, then you must be listed (one user per line)
therein in order to be  allowed to use this  command. If the /etc/cron.allow file
does not exist but the /etc/cron.deny file does exist, then you must not be listed
in the /etc/cron.deny file in order to use this command.

If neither of these files exists, then depending on site-dependent configuration
parameters, only the super user will be allowed to use this command, or all users
will be able to use this command.

If  both  files  exist  then  /etc/cron.allow  takes  precedence.  Which  means that
/etc/cron.deny is not considered and your user must be listed in /etc/cron.allow in
order to be able to use the crontab.

Regardless of the existance of any of these files, the root administrative user is
always allowed to setup a crontab. For standard Debian systems, all users may use
this command.

I gave it try on Debian 7, and it is working exactly this way.

|improve this answer|||||
  • Wops! I have not thought to look in the man!! so silly! thankyou! Great also i don't have to do nothing, because only the root was exaclty what i wanted! – lese May 20 '14 at 15:39
  • I'm not sure that you can add root to cron.deny – confiq Sep 3 '14 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.