How make some folder read/write permission to one user

permissions

I have different folders in a linux (certos) directory.

Now i want only one user out of all to have read/write permission to all those folders.

How can i do that

thanks

Best Answer

EDIT: I don't want to chnage the owner , as i want original owner to do read and write as well

Then you should create a group that includes the original owner as well as this other user and set group permissions to that folder with the new group.

Example, you have 2 users - user1 and user2.

  • Create a new group that contains only the users you want to have access:

    groupadd newgroup

  • Assign each of those users to that group:

    usermod -G newgroup user1

    usermod -G newgroup user2

  • Change ownership and permissions of the directory, do this for each folder:

    chown user1:newgroup FOLDER_EXAMPLE

    chmod 770 FOLDER_EXAMPLE

I believe this is what you are after.