You are not logged in.

#1 2012-08-03 18:03:05

gilmoreja
Member
From: Florida
Registered: 2012-05-28
Posts: 77

[solved] files in /var/log and their ownership

Is there a reason why all the system log files are mode 640?

So far I'm in love with Linux (Arch especially) and really enjoy using terminal windows and logging in as root to do productive things (I really do love command-line-wrangling -- my first computer was a DOS machine), but it really seems like an unnecessary hoop to jump through to have to log in as root just to view a log file.

Is there any compelling reason to not set these log files mode 644? If there's no specific reason, could changes be made to have this be default behavior?

Last edited by gilmoreja (2012-08-04 02:06:12)


Time you enjoy wasting isn't wasted time.

Offline

#2 2012-08-03 18:35:57

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [solved] files in /var/log and their ownership

If you want to change the default on your machine, have a look at /etc/syslog-ng/syslog-ng.conf, specifically the perm option. I am pretty sure the reason logfiles aren't readable by everyone is for security reasons, there might be sensitive information in the logs you don't want everyone on the server to see.

Offline

#3 2012-08-03 18:37:53

Radioactiveman
Member
From: Germany
Registered: 2010-05-13
Posts: 389

Re: [solved] files in /var/log and their ownership

# usermod -aG log USERNAME

Offline

#4 2012-08-03 18:47:11

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,638
Website

Re: [solved] files in /var/log and their ownership

Most of my logs are 644, the exceptions being:

  • /var/log/ConsoleKit/history is 640

  • /var/log/httpd/ssl_request_log is 666 (for some reason)

I'm fairly certain this is default. I am using systemd though, where most system logs are stored in the journal.

I can't see any problem with you manually modifying the permissions on your log files. They're there for your benefit after all.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2012-08-03 19:09:57

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [solved] files in /var/log and their ownership

gilmoreja wrote:

Is there any compelling reason to not set these log files mode 644? If there's no specific reason, could changes be made to have this be default behavior?

Logs can of course contain some sensitive info and I would say it's a good thing that the defaults provide a little security.

WorMzy wrote:

I can't see any problem with you manually modifying the permissions on your log files. They're there for your benefit after all.

Adding yourself to the log group as Radioactiveman says is easier (and pretty much the same question was answered here maybe a week ago).

[edit:typo]

Last edited by Raynman (2012-08-03 19:10:23)

Offline

#6 2012-08-04 01:57:53

gilmoreja
Member
From: Florida
Registered: 2012-05-28
Posts: 77

Re: [solved] files in /var/log and their ownership

Radioactiveman wrote:
# usermod -aG log USERNAME

Thanks for that, and to everyone else for the insights.

I did not realize there was a group set aside especially for log files.

Last edited by gilmoreja (2012-08-04 02:06:59)


Time you enjoy wasting isn't wasted time.

Offline

Board footer

Powered by FluxBB