Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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