I created an LDAP group rcars. I also created a directory rcars. How can I set permission so that only rcars group can read/write?

  • Does your system use LDAP for its group memberships? Have you looked at the chmod and chgrp commands?
    – roaima
    Jul 10 '18 at 19:44
  • yes it uses LDAP. I have tried both chmod & chgrp as well. Jul 10 '18 at 19:46

The rcars directory will first need to be part of rcars group (the folder's owner or root can perform this operation).

Syntax: chgrp <groupName> -R <folderName>

 chgrp rcars -R rcars 

Then, the rcars group will need rw permissions of the directory.

Syntax:chmod g+rw <folderName>

 chmod g+rw -R rcars 

To remove others access:

chmod o-rw -R rcars
  • -R is for recursive permission (all sub-directories and files in it).
  • Thank you. The group was changed to rcars. However the perms still remain drwxrwsr-x Jul 10 '18 at 19:40
  • @MervynClarke try my updated answer.
    – Siva
    Jul 10 '18 at 19:43
  • Thanks that did it. I also did the same for the user. chmod u-rw -R rcars. Thanks again. Jul 10 '18 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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