5

There are many log files in /var/log that I do not have permission to read with my normal user. I have to use sudo to add read permission first. It's getting annoying, especially having to repeat the same thing on different machines.

Is there a good reason for this?

2 Answers 2

2

The /var/log files contain logged data, http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/var.html , important to note-
"/var/log/wtmp, which logs all logins and logouts into the system"
"/var/log/messages, where all kernel and system program message are usually stored"

These areas contain tons of detailed information about your system, and if even read by an outside service, could be used to compromise your whole system. I would advise not to change the permissions on this folder.

3
  • Well yes, I have only changed specific permissions for example, for the /var/log/lighttpd folder.
    – z7sg
    Apr 18, 2012 at 14:18
  • I will accept your answer but as I need constant access to those logs it's too inconvenient not to change the permissions there and I can't imagine the information would compromise anything.
    – z7sg
    Apr 18, 2012 at 21:18
  • Here is a link for making various shortcuts for opening files as root, maketecheasier.com/…
    – Mateo
    Apr 18, 2012 at 21:30
-3

The permissions are set like this for security purposes on servers and production machines. If you are just using a personal desktop or laptop that's not hosting anything to the outside world, then it probably doesn't matter.

If you feel like diddling with the permissions, then you can always try a chmod -R 666 on the log directory, although I'm not sure if this will break anything when it comes to the log writers needing specific permissions on the files, or if the permissions will not change when the logging software decides to change the logs. However, I still think the best way to view the files is with a

sudo less filename

It's only one little extra sudo.

0

You must log in to answer this question.

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