1

I currently have the following directory:

drwxrwsr-x   4 user1 Group1 4.0K Apr 18 18:29 foo

Under Group1 there are 20 users. I want to give user2 and user3 who belong to Group1 access to directory foo and restrict access to this directory to everyone else. Can someone please tell me how to achieve this?

1 Answer 1

2

Create a new group, add user2 and user3 to that group. Change the group ownership of the directory to the new group.

5
  • May be a dumb question but what if I don't have the ability to execute groupadd? My server complains: groupadd: unable to lock group file
    – Legend
    Apr 18, 2012 at 22:45
  • Are you running it as root? If all else fails, strace it and see exactly what operation is failing. Apr 18, 2012 at 22:46
  • I don't have root privileges on the server so I guess that is the problem I am running into. Running strace tells me that the permission was denied while accessing /etc/.pwd.lock file.
    – Legend
    Apr 18, 2012 at 22:48
  • 1
    Then you'll either have to ask the root user to create the group for you or use access control lists if your system supports them. If your need is legitimate, I'd suggest asking the system administrator how you should meet it. Apr 18, 2012 at 22:51
  • +1 Thank you. I just emailed my admin. Hopefully he will get back soon. Thanks for your help.
    – Legend
    Apr 18, 2012 at 22:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .