LinuxQuestions.org
Register a domain and help support LQ
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 12-16-2013, 05:49 PM   #1
loadedmind
Member
 
Registered: Sep 2003
Location: Texas
Distribution: Red Hat/CentOS
Posts: 290
Blog Entries: 1

Rep: Reputation: Disabled
Group permissions


Hey all. I have a test user account that I've created that has somehow affiliated itself to a group that I didn't associate. I've got a test LDAP environment and I'm ssh'ing into a machine as this user successfully.

I have a group called lusers with a GID of 1001 and another group called users with a GID of 100. Under my /home/testuser/ directory, I see that there are a bunch of directories and files owned by testuser.1001 and I would like to associate them to testuser.100. Is there an easy way to do this versus changing them individually?

Additionally, if I no longer wish to use the lusers group (in order to prevent my other testuser2 and testuser3 accounts from somehow wrongfully associating with it, is there a best practices method to achieve this result?

Many thanks for any/all feedback.

Last edited by loadedmind; 12-16-2013 at 05:51 PM. Reason: Additional Info
 
Old 12-16-2013, 05:59 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Code:
find /home/testuser -group 1001 -exec chgrp 100 {} \;
That will find any files/dirs anywhere in /home/testuser that are currently in group 1001, and change them to group 100.

If you want to prevent a certain user from accessing files in a given group, you would simply remove that user from the group (assuming the permissions on the files had already been set up to keep all users out and only allow the owner and group access).

Last edited by suicidaleggroll; 12-16-2013 at 06:01 PM.
 
Old 12-16-2013, 10:45 PM   #3
loadedmind
Member
 
Registered: Sep 2003
Location: Texas
Distribution: Red Hat/CentOS
Posts: 290
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Thanks. I actually found that the -h flag for chgrp works best.
 
Old 12-17-2013, 12:58 AM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
The -h flag tells chgrp to change the group of a symbolic link itself rather than the target. How does that help?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
setfacl changes group permissions; giving another user rw permissions secretlydead Linux - Server 4 09-23-2012 12:12 AM
Group permissions: user can't access 770 directory even though a member of group jm34003 Linux - Security 13 05-16-2012 03:03 PM
Member of group root, but root group permissions don't apply? aeternitas Linux - Software 7 04-22-2010 12:06 AM
Secondary group users need to change the file permissions of primary group files? sunnybmv Linux - Newbie 3 12-10-2009 05:57 PM
permissions not recognizing group or assigned users to group blckspder Linux - Server 1 07-28-2008 11:32 AM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration