You are not logged in.

#1 2010-04-21 18:22:50

SoleSoul
Member
From: Israel
Registered: 2009-06-29
Posts: 319

[solved] How to give one group read permission to file?

Hi!
How can I give the group "logreaders" a permission to read /var/log/messages? and how can I give them read access to the whole /var/log directory?
Thanks!

Last edited by SoleSoul (2010-04-21 20:54:00)

Offline

#2 2010-04-21 19:09:39

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [solved] How to give one group read permission to file?

One thing is no two UNIX systems are guaranteed to do permissions the same way. You could be using SELinux with root as NTFS and no standard advice would even apply. So basically this is one of those you-need-to-know-your-own-system situations where you Google for answers yourself.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2010-04-21 19:18:21

SoleSoul
Member
From: Israel
Registered: 2009-06-29
Posts: 319

Re: [solved] How to give one group read permission to file?

Thank you for your answer.

Ow, of course I googled... The forum is usually my last resort.

I didn't really understand your answer though.

I don't use SElinux, ext3 filesystem, quite normal linux box.
Can you give me at least one possible scenario and it's way of doing things so I could see how this works?

Offline

#4 2010-04-21 19:19:03

Zeist
Arch Linux f@h Team Member
Registered: 2008-07-04
Posts: 532

Re: [solved] How to give one group read permission to file?

I think that reading this could be helpful:

http://www.yolinux.com/TUTORIALS/LinuxT … roups.html


I haven't lost my mind; I have a tape back-up somewhere.
Twitter

Offline

#5 2010-04-21 19:35:12

antlechrist
Member
Registered: 2010-04-21
Posts: 26

Re: [solved] How to give one group read permission to file?

This is one example:

$ man chown
$ man chmod
...
# chown root:logreaders /var/log/messages
# chmod g+r /var/log/messages

Zeist's link has good information.

Offline

#6 2010-04-21 19:40:41

SoleSoul
Member
From: Israel
Registered: 2009-06-29
Posts: 319

Re: [solved] How to give one group read permission to file?

Thank you very much everyone!
I settled on this solution:
# chown root:logreaders /var/log/messages
# chmod g+r /var/log/messages

I got to this conclusion before seeing your post and I was very happy to see from your post that I wasn't wrong.
Thanks for the link Zeist.
I thought before that each file can have it's own list of groups and users which can read/write to it. I was wrong.

Learned something.

Last edited by SoleSoul (2010-04-21 19:44:51)

Offline

#7 2010-04-21 19:57:22

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [solved] How to give one group read permission to file?

fsckd wrote:

One thing is no two UNIX systems are guaranteed to do permissions the same way. You could be using SELinux with root as NTFS and no standard advice would even apply. So basically this is one of those you-need-to-know-your-own-system situations where you Google for answers yourself.

NTFS for root? o.O


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#8 2010-04-21 20:03:59

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [solved] How to give one group read permission to file?

lol i think fsckd was just trying to prove a point.

@SoleSoul, at least on my system most files in /var/log are already readable by members of the group "log".  adding users to this group might've been a better approach...

Last edited by brisbin33 (2010-04-21 20:04:11)

Offline

#9 2010-04-21 20:53:25

SoleSoul
Member
From: Israel
Registered: 2009-06-29
Posts: 319

Re: [solved] How to give one group read permission to file?

ah brisbin... I wish I would have worked on Arch.
The server I'm working on right now belongs to my university and it runs CenOS 5.3.
Almost all of the content of /var/log is root:root.

Thanks for the tip anyway.

Offline

#10 2010-04-21 21:34:44

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [solved] How to give one group read permission to file?

brisbin33 wrote:

lol i think fsckd was just trying to prove a point.

Bingo. cool


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

Board footer

Powered by FluxBB