Who should own /var/log and /var/tmp
Solution 1:
This is total /var/
:
drwxr-xr-x 2 root root 4096 jul 19 07:56 backups
drwxr-xr-x 18 root root 4096 mrt 29 07:51 cache
drwxrwsrwt 2 root whoopsie 4096 jul 19 07:35 crash
drwxr-xr-x 72 root root 4096 jul 19 10:14 lib
drwxrwsr-x 2 root staff 4096 feb 27 19:33 local
lrwxrwxrwx 1 root root 9 mrt 29 07:47 lock -> /run/lock
drwxrwxr-x 15 root syslog 4096 jul 19 07:56 log
drwxrwsr-x 2 root mail 4096 mrt 20 08:31 mail
drwxrwsrwt 2 root whoopsie 4096 mrt 20 08:37 metrics
drwxr-xr-x 2 root root 4096 mrt 20 08:31 opt
lrwxrwxrwx 1 root root 4 mrt 29 07:47 run -> /run
drwxr-xr-x 9 root root 4096 mrt 20 08:35 spool
drwxrwxrwt 2 root root 4096 jul 19 13:52 tmp
Have fun
Solution 2:
Both should be owned by root, the group for /var/log
should be syslog
, and it should be world-writable.
Solution 3:
I also totally screwed all ownerships and groups up in /var/log
. Since I have have a separate 21.04 Ubuntu, it allowed me to determine what they should be:
root root 104003 Feb 1 2021 bootstrap.log
syslog adm 0 Aug 22 00:00 mail.err
root root 573 Aug 25 21:54 fontconfig.log
root adm 0 Sep 3 00:00 apport.log
root root 162 Sep 9 15:25 alternatives.log
root root 32064 Sep 13 17:30 faillog
syslog adm 109207 Sep 16 16:32 cloud-init-output.log
syslog adm 1943745 Sep 16 16:32 cloud-init.log
root root 38778 Sep 16 19:03 dpkg.log
root adm 764861 Sep 16 21:03 dmesg
root root 6370 Sep 17 15:27 ubuntu-advantage.log
root utmp 2783616 Sep 17 19:59 btmp
root utmp 202752 Sep 17 20:06 wtmp
root utmp 292584 Sep 17 20:06 lastlog
syslog adm 877 Sep 17 20:42 mail.log
syslog adm 977 Sep 17 20:48 auth.log
syslog adm 43183 Sep 17 20:50 ufw.log
syslog adm 422976 Sep 17 20:50 syslog
syslog adm 57150 Sep 17 20:50 kern.log