LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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
 
LinkBack Search this Thread
Old 02-04-2012, 10:16 AM   #1
chiraag
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Rep: Reputation: Disabled
Using credentials of multiple groups simultaneously


Hello,

I have a set up where I am trying to create a hierarchy of user groups. That is to say, there are developers and project managers etc. project managers can access all the files developers can access and some that developers cannot. For this, I have two groups, devel and projman. A project manager belongs to both the groups but his primary group is projman.

Now my question is simple. Is there a way for a project manager to access files that are accessible only by the devel group, without having to switch between his projman and devel groups? What I mean is, how do I let my project manager to use the credentials of both his group memberships simultaneously? I'm hoping there's a simple solution to this that I haven't been able to find.
 
Old 02-04-2012, 10:51 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,853

Rep: Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121
credentials of groups? what are you talking about?? is this an application you're logged into? You talk about file access, but your other comments don't relate at all to how you would use files directly on a filesystem.

Maybe you just want ext3 acls??

Last edited by acid_kewpie; 02-04-2012 at 11:17 AM.
 
Old 02-05-2012, 10:23 PM   #3
chiraag
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
@acid_kewpie - perhaps credentials was the wrong word to use. What I mean is that since a project manager belongs to two groups, I want him to be able to access files available to either of the group, without having to change his primary group.

So, for instance, if there are 2 files on my system:

-rwxrwx--- admin devel file1.cpp
-rwxrwx--- admin projman file2.cpp

Project Manager belongs to both devel and projman groups. Can he access both files, without changing his "current group"* from devel to projman or vice-versa?

.....

As it turns out, it works. Not sure why it didn't yesterday. Anyhow, I hope the question is clearer now, even if I still look like an idiot


Thanks!
 
Old 02-06-2012, 04:42 AM   #4
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,551
Blog Entries: 3

Rep: Reputation: 815Reputation: 815Reputation: 815Reputation: 815Reputation: 815Reputation: 815Reputation: 815
Quote:
Originally Posted by chiraag View Post
So, for instance, if there are 2 files on my system:

-rwxrwx--- admin devel file1.cpp
-rwxrwx--- admin projman file2.cpp

Project Manager belongs to both devel and projman groups [...]
therefore he can access both files.

I have used group-based access controls on a number of servers, and I can recommend it. There are a couple of points to note:
  • Set umask to 0002 for all users.
    This ensures the files they create will by default be both readable and writable by their group.
    The best place to do this is in the shell startup files in /etc/, so the setting is universal (for all users with non-system uids, i.e. uid > some-number).
  • Set the setgid bit, g=rwxs for all directories.
    When the setgid bit is set, all files and all subdirectories created in that directory will inherit the group from the directory. (Normally, the primary group of the user is used.)
    Also, subdirectories will inherit both the group and the setgid bit.
  • NFSv3 will only handle the first 15 (if I remember correctly) supplementary groups for each user.
    This means that if a project manager is involved in a lot of groups, they'll encounter problems if using NFSv3 shares. You can fix those problems either by using NFSv4, or by teaching the managers to use a simple tool that will change their supplementary group memberships based on directories they specify. (That is, they don't need to know which groups they want in the supplementary list, only which directories they want to access next/at the same time, and the tool will modify the supplementary group list accordingly.)

Quote:
Originally Posted by chiraag View Post
As it turns out, it works. Not sure why it didn't yesterday. Anyhow, I hope the question is clearer now, even if I still look like an idiot
No worries!

Like I said, I've used this extensively. One thing I've found exceedingly useful is that since all accesses are determined based on the group membership, you can use the owner information to track the user who "owns" the files. This is especially useful when monitoring changes to files that are not in a repository. Most useful use case thus far has been tracking web page edits when there is a often-changing group of web administrators.

If the users use nano, vi,or emacs to edit the files directly, you can use a wrapper that locks the file and edits a newly created copy, to avoid errors from simultaneous edits, and to ensure the file owner always tells who edited the file last.

If you have any questions, or have use cases (or complex situations), feel free to PM me; I'd be very happy to discuss some of the techniques and details and solutions either here, in another thread, or privately.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to write multiple threads working simultaneously ? indian Programming 3 09-19-2011 11:41 PM
Use multiple audio devices simultaneously mittfh Linux - Software 2 10-31-2009 08:44 PM
multiple tcpdumps running simultaneously? genmaicha Linux - Networking 1 07-22-2009 02:16 AM
multiple pppoe sessions simultaneously zomane Linux - Networking 0 04-23-2008 01:44 AM
Multiple Blade servers booting from multiple disk drives simultaneously NGC_cheryl Linux - Enterprise 0 11-27-2007 04:44 PM


All times are GMT -5. The time now is 04:49 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration