LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-30-2004, 06:29 PM   #1
NonSumPisces
Member
 
Registered: May 2004
Location: Västerås, Sweden
Distribution: Slackware Current
Posts: 228

Rep: Reputation: 30
A couple of questions about files and usergroups


1: Can a file/dir belong to many groups and users? (excessive, yes, but I'm dealing with a windows disc here ^_^)
2: If 1 is yes, how do I do that?
3: How do I view what groups a user is in?
4: How do I change what groups a user is in?

/Marcus
 
Old 07-30-2004, 07:08 PM   #2
Ankheg
Member
 
Registered: Jul 2004
Location: Woodland Hills, CA
Distribution: Debian/Mandrake
Posts: 37

Rep: Reputation: 15
1-2. Short answer, is no... However....
Each file or directory has one owner and one group designation. What I would do to achieve similar results, is to create a new group that contains the users from the various other
groups that would need to access whatever file/directory, and set that file to belong to the group that you setup. It makes for a little more on the maintenance side (though not much), but it should still get the job done.

3-4. /etc/group - This will contain a list of all of the groups and list all of the users in each group. This is also what you modify when moving people in/out of groups.


Hope that helps.
 
Old 07-30-2004, 07:09 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
(1) Nope -- in the traditional Unix sense, a file system belongs to one user, and one group. If user/group access permissions are not sufficient, many filesystems these days support access control lists (ACLs) a la Windows, but it's something that usually has to be specially enabled.

(3) id <user> or groups <user>

(4) The user's primary group is the 4th field in /etc/passwd -- otherwise you can add the user to the appropraite group entry in /etc/group. An /etc/group entry looks like

Code:
groupname:Password*:gid:member1,member2,member3
* group passwords aren't used anymore. They were useful way back in the day when a user could only belong to one group at a time.

to remove a user from a group, just delete his name from the corresponding line. There are pretty GUI tools to do it, too.
 
Old 07-31-2004, 07:31 AM   #4
NonSumPisces
Member
 
Registered: May 2004
Location: Västerås, Sweden
Distribution: Slackware Current
Posts: 228

Original Poster
Rep: Reputation: 30
Okay, thx. I have a removeable hd formatted in fat, and I share it on my ftpserver, but the thing is, it seems impossible for other users of the same group than the one that mounts it, to use it.
I need a solution to this.

root@Nyarlathotep /export $ ls -l
total 34
drwxrwxr-x 7 anv users 152 2004-07-30 00:07 archive1
drwxrwxr-x 3 anv users 48 2004-07-29 23:04 archive2
drwxr--r-- 4 mattias users 32768 1969-12-31 23:00 storage
drwxrwxr-x 2 anv users 48 2004-07-30 01:15 tmp
root@Nyarlathotep /export $ su mattias
mattias@Nyarlathotep /export $ chmod -R g+rx storage/
mattias@Nyarlathotep /export $ ls -l
total 34
drwxrwxr-x 7 anv users 152 2004-07-30 00:07 archive1
drwxrwxr-x 3 anv users 48 2004-07-29 23:04 archive2
drwxr--r-- 4 mattias users 32768 1969-12-31 23:00 storage
drwxrwxr-x 2 anv users 48 2004-07-30 01:15 tmp
mattias@Nyarlathotep /export $


It simply won't change the access rights to it. I want the user viktor to be able to access the dir storage, but he can't. He can access the other dirs, but not storage.

Any ideas?
 
  


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
a couple questions maybbach Linux - Newbie 7 04-14-2004 11:30 PM
Couple of questions about Dual-booting, and .TARred files Subwall Linux - Newbie 1 02-27-2004 07:07 AM
Couple of easy questions on Suse startup files and QT digitized_funk Linux - Newbie 1 10-15-2003 11:17 PM
Couple of questions figadiablo Linux - General 1 10-01-2002 10:54 AM
couple O' questions pathogenik Slackware 10 04-22-2002 01:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:48 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