LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-30-2002, 03:04 PM   #1
once
LQ Newbie
 
Registered: May 2002
Posts: 28

Rep: Reputation: 15
group permissions


I have a directory say PETS, I have two groups CAT, DOG.
CAT has read access to PETS..
DOG has read / write access to PETS.

Can this be done in linux.

As unix/linux uses xxx for permissions, there is only one group that can have access to that directory. Is this a weekness in linux??.

Thanks

Derrick
 
Old 05-30-2002, 03:10 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well no because you have three levels in the system, and seeing as you started it i'll use your analogy:

Owner: Rover
Group: Dogs
Others: Cats

so file with attribs a'la "ls" of say, rwxrwxr-x (or alternatively noted as 775) say that Rover made the file and any other dog can look change it, but anyone who isn't a dog, e.g. a cat can only look at the file.

a weakness?? LINUX IS INVINCIBLE!!!

hmm, funny analogy to bring up right now, as i'm currently burning a divx copy of Cats And Dogs to a cdr Go Lou!
 
Old 05-30-2002, 03:16 PM   #3
once
LQ Newbie
 
Registered: May 2002
Posts: 28

Original Poster
Rep: Reputation: 15
I know LINUX IS INVINCIBLE but I do not want xx4 on my pets directory
 
Old 05-30-2002, 03:18 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well set the correct permissions on it and only a certain group will have access. i'd assume that if a file owner is a memeber of two groups then naturally all members of those two groups would inherit group perms... sounds bloody obvious actually!
 
Old 05-30-2002, 03:26 PM   #5
once
LQ Newbie
 
Registered: May 2002
Posts: 28

Original Poster
Rep: Reputation: 15
Samab

Did I forget to mention I am using samba, so that x?x . So at the ? I need to define two groups, one for read and one for read/write.

Help me understand

thanks
 
Old 05-30-2002, 03:33 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
erm, can you clarify exactly where this xxx notation has come from? i'm really struggling to see what you're getting at.... the group with read write will be the one in which the owner belongs. all other groups will have the lesser set, whatever you choose them to be...
 
Old 05-30-2002, 03:57 PM   #7
once
LQ Newbie
 
Registered: May 2002
Posts: 28

Original Poster
Rep: Reputation: 15
Ok.
my xxx notation is User / Group/ Other

7 Read, write, exectable
6 Read Write
5 Read only exec
and so on.

I have a directory called /home/PETS/

I have the groups CATs, DOGs

A user from the group Dog makes a new file (touch myfile)

I need all users of the group DOGs to have read / write access to "myfile".

I need all the users from CATs to only have read access to "myfile".

There are five useres in DOGs and five users in CATs.

Tanks
 
Old 05-30-2002, 03:59 PM   #8
once
LQ Newbie
 
Registered: May 2002
Posts: 28

Original Poster
Rep: Reputation: 15
Addition
Others cannot have access
 
Old 05-30-2002, 04:00 PM   #9
Noerr
Member
 
Registered: May 2002
Location: Dalec, HU
Distribution: Redhat 7.3
Posts: 696

Rep: Reputation: 30
once:
If you want to get multiple user or group permisions you will have tough time setting them up in linux. You are right that this is a weakness of Linux

if you don't know that you can use ACLs (Access Control Lists) and EA (Extended Attributes) which will enable just that

say you have dir /mama you can say
setfacl -m u:joe:rwx -m u:john:rwx ... /mama
then you can play around just like in Win nt/2k/xp

but it's not so trivial to get this working
goto acl.bestbits.at to get all info
but in short
you have to patch kernel, install fileutils, acl, ea utils, compile support for acl and reboot
(very easy and straight forward if you have done it before)

good luck
 
Old 05-30-2002, 04:13 PM   #10
once
LQ Newbie
 
Registered: May 2002
Posts: 28

Original Poster
Rep: Reputation: 15
Hi Noerr De Dykul

Any ideas how this will react with samba. I will definatly look at your sugestions, but just maby you have quick awnser.

Thank you
 
Old 05-30-2002, 05:27 PM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well yeah you can't specify that fundamentally, but then you can continually go round in ever decreasing circles with more and more demands on what you can and can't do with a file system. *nix file systems still totally trash FAT32 / NTFS. as to how it will relate to sharing over samba.. well why samba? assuming you're going from linux to linux then you should use nfs, and then you'll be back to the same rights issues as for a native file system. I don't think that samba will help at all, probably hinder, but as i don't share any nix drives of samba directly i don't know.
 
Old 05-31-2002, 01:32 AM   #12
once
LQ Newbie
 
Registered: May 2002
Posts: 28

Original Poster
Rep: Reputation: 15
It is a File server for windows clients.
 
Old 05-31-2002, 04:00 AM   #13
Noerr
Member
 
Registered: May 2002
Location: Dalec, HU
Distribution: Redhat 7.3
Posts: 696

Rep: Reputation: 30
once: it works perfectly well with samba, all you need to do is include support for acl while compiling
to help you there is my configure statement for samba

./configure --prefix=/usr --sysconfdir=/etc/samba --libdir=/etc/samba \
--localstatedir=/var/log/samba --with-smbmount --with-quotas --with-automount \
--with-smbwrapper --with-acl-support --with-ssl

=====
that is a little more than acl support only but works fine and samba gets installed without that /usr/local prefix which bothers me big time
 
Old 05-31-2002, 08:35 AM   #14
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
Ummm....

If you are only concerned about this for Samba, then why don't you just specify this in the smb.conf file instead of worrying about it with the directory permissions?
 
Old 05-31-2002, 04:16 PM   #15
Noerr
Member
 
Registered: May 2002
Location: Dalec, HU
Distribution: Redhat 7.3
Posts: 696

Rep: Reputation: 30
without acl, you have a very tough time to do simple things like

joe can rx my dir , and john can rwx my dir ...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
group permissions nanjil SUSE / openSUSE 4 10-20-2005 01:51 PM
regarding group permissions zameer_india Linux - Networking 1 02-11-2005 04:07 AM
Group Permissions (m9.2) PaladinCowboy75 Mandriva 4 05-06-2004 08:20 AM
Group Permissions mallikarjun Linux - Security 4 07-03-2002 04:37 PM
group permissions once Linux - Newbie 5 06-02-2002 03:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration