Hi,
How can i give read access to logs for other users? Perhaps the solution is to set group for this files and add some users there. But how to do that for /var/log/maillog? I mean, logrotate will reset perms? If i change group from root to another won't it generate any problems?
Actual state: -rw------- 1 root root 337M kwi 22 15:40 maillog
-
You can add an entry to
/etc/logrotate.confor wherever your config for the particular log is (most likely in/etc/logrotate.d/<blah>)create 0664 root utmpThis tells logrotate to create a new log with 664 permissions and make it owned by user
rootand grouputmp.You will probably want something like
create 0644 root root, unless you only want a specific group to have read access. in that case make itcreate 0640 root <your group>From solefald -
What syslog engine are you using?
syslog-ngmay be handling file permissions.You will have lines such as:
# Default permissions options { perm(0640); }; # Custom file target destination localmessages { file("/var/log/localmessages" perm(0644)); };If you're using
syslog-ng, use its capabilities to set your logfile permissions in general.If you need specific things (i.e. fred needs to see
/var/log/mail) I recommend usingsudoinstead.From MikeyB -
Thanks for all answers, i have used sudo and it works brilliant. Something like that:
user1, user2, user3 ALL=NOPASSWD: /bin/cat /var/log/maillog
rgrds
0 comments:
Post a Comment