# /etc/ntp.conf file permissions changing



## nxe (Jun 13, 2014)

On my FreeBSD 9.2 server normally have group write access available on /etc/ntp.conf but I've noticed the file permissions seems to reset itself every so often. It causes a minor annoyance and I know I can write a simple cron job to check and change the permissions but I was wondering if there was a simpler way to tell what might be changing its permission to stop.

I did a quick google search and couldn't find anything relevant and I tried rebooting the system to see if a system reboot causes but it does not. It seemly happens randomly.

I'm either looking for a way to prevent the file from having its permissions changed, or finding a way to monitor the file and stop whatever is changing the files permissions.


----------



## junovitch@ (Jun 14, 2014)

```
root@rtr:/etc/periodic # grep -R chmod *
weekly/310.locate:	chmod 644 $locdb || rc=3
weekly/310.locate:	chmod 444 $locdb || rc=3;;
root@rtr:/etc/periodic # cd /usr/local/etc/periodic/
root@rtr:/usr/local/etc/periodic # grep -R chmod *
root@rtr:/usr/local/etc/periodic #
```

I don't see anything that looks like it would change permissions.  When is the last time the permissions change? `stat -f "%Sc" /etc/ntp.conf`. What was running when it did?


----------



## wblock@ (Jun 14, 2014)

What are the permissions before and after the change?


----------



## nxe (Jun 16, 2014)

junovitch said:
			
		

> When is the last time the permissions change? stat -f "%Sc" /etc/ntp.conf. What was running when it did?



Unfortunately, the last time the permission changed was Friday when someone decided to make it group writable again. As for things running I'm going to have to compile a quite a huge list and sort through those.




			
				wblock@ said:
			
		

> What are the permissions before and after the change?



It changed from 664 to 644. Everything else on the file stayed the same. Thankfully, I should be able to use stat to check when it changes and see what was running at the time.


----------

