Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I edit /etc/hosts as a first line of defense to stop me going to certain distracting sites during the working day.

Ideally I'd like to have two versions of hosts and a cron job that switches them at 9am and 5pm during the day, but I think that there is a permissions issue running cron under sudo... should I just reduce the permissions on hosts?

share|improve this question
up vote 1 down vote accepted

You shouldn't need to change permissions of any system file.

I don't see any issue just doing everything under root, i.e. by opening a root shell, and editing the crontab.

sudo -i
crontab -e

You can also directly edit root's crontab with:

sudo crontab -u root -e
share|improve this answer

You must log in to answer this question.

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