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. |
Code:
find /home/testuser -group 1001 -exec chgrp 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). |
Thanks. I actually found that the -h flag for chgrp works best.
|
The -h flag tells chgrp to change the group of a symbolic link itself rather than the target. How does that help?
|
All times are GMT -5. The time now is 03:48 AM. |