I have created a group in RHEL with one user in it. This user will need full rwx access to /home/anotheruser/ ,recusively. How do I change the user/group permission to allow that user/group to rwx in /home/anotheruser/

If I do a vi group in /etc/ this is what is says:

usergroup:x:505:user123

Also, what is the :505: mean?

Thank you for any input!

link|improve this question
feedback

1 Answer

505 is the group ID.

You need to put the both users in one group and make the /home/anotheruser/ can be writable by group:

usermod -a -G usergroup anotheruser
chmod -R g+w /home/anotheruser/ 

Change umask to 0002 so newly created folder will has permission 775.

echo "umask 0002" > /home/anotheruser/.bashrc

Set SGID bit for all folders in /home/anotheruser/ to make all folders created by user1 will be owned by usergroup group:

find /home/usergroup -type d -print0 | xargs -0 chmod g+s /home/usergroup
link|improve this answer
Great, before I execute these commands... do I have to be in root? Any specific place as to where I should execute them? Can this mess up my files or permissions in the /anotheruser/ directory? – mcfan123 Aug 17 '11 at 3:03
1  
@mcfan123 - Yes to being root and the potential to mess stuff up. No to needing to be in a specific directory when you run those commands. You seem unfamiliar with Unix permissions concepts. I suggest reading up on them before taking any action to make sure you don't create unintended nasty surprises. zzee.com/solutions/unix-permissions.shtml is a good starting point. – voretaq7 Aug 17 '11 at 3:07
will the umask 0002 change all umasks? – mcfan123 Aug 17 '11 at 3:18
thanks for the help btw – mcfan123 Aug 17 '11 at 3:20
my current bash setup is if [ $UID -gt 99 ] && [ "id -gn" = "id -un" ]; then umask 002 else umask 022 fi – mcfan123 Aug 17 '11 at 3:26
show 7 more comments
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.