Question

what are the default owner:group of the directories in /var?

Posted October 21, 2013 3.1k views
I am a noob, and chown'd everything in /var. I have LAMP on Ubuntu 12.04 and would like to get the following directories properly owned: backups cache lib local lock log mail opt run spool tmp TIA

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers
Sorry, but you actually screwed it up. You can't undo the chown command. However, since it's just the /var directory that have messed permissions, you could try to fix them manually. On my Ubuntu 12.04 machine, permissions are as follows:


drwxr-xr-x 13 root root 4096 Oct 16 18:48 .
drwxr-xr-x 22 root root 4096 Sep 9 05:02 ..

drwxr-xr-x 2 root root 4096 Oct 17 07:35 backups
drwxr-xr-x 12 root root 4096 Sep 9 09:17 cache
drwxr-xr-x 40 root root 4096 Oct 15 15:44 lib
drwxrwsr-x 2 root staff 4096 Apr 19 2012 local
lrwxrwxrwx 1 root root 9 Oct 8 09:45 lock -> /run/lock
drwxr-xr-x 9 root root 4096 Oct 22 07:35 log
drwxrwsrwt 2 root mail 4096 Oct 21 23:15 mail
drwxr-xr-x 2 root root 4096 Apr 26 2012 opt
lrwxrwxrwx 1 root root 4 Oct 8 09:45 run -> /run
drwxr-xr-x 8 root root 4096 Sep 23 05:31 spool
drwxrwxrwt 2 root root 4096 Sep 9 05:02 tmp
drwx------ 2 root bin 4096 Oct 8 09:45 webmin
drwxr-xr-x 25 root root 4096 Oct 16 09:50 www


and /var
drwxr-xr-x 13 root root  4096 Oct 16 18:48 var


Be very careful when you're setting permissions.
"...chown'd everything in /var."

Why would you do that? Did you read that somewhere?
I was trying to set the www directories and didn't think about other directories in /var.

Thanks Oliver!
Submit an Answer