1

I want to grant a group "usera" rwx permission to a directory. The directory is already owned by a user that belongs to this group "usera". The name of the username and group is same.

Current Permissions:

If I check the current permissions of that directory by running the following command:

ls -la

Following is the output:

drwxrwsrwx 2 usera        usera        4096 Jan  9 09:30 .

Desired Output:

drwxrwxrwx 2 usera        usera        4096 Jan  9 09:30 .

Problem Statement:

The problem is that the above-mentioned usera doesn't have ssh access to the server. So, I have to login via another user with admin privileges. And I want to grant group "usera" rwx permissions on a particular directory /opt/test/abcd. But I am unable to figure out which command to run. I know we can grant permissions by using chmod command but how to apply it in this context

2
  • Please update your question and include a description of what happens when you try to access the content in this directory. Commented Jan 9, 2018 at 15:11
  • The output you show, shows rwx permission. It also shows that the group currently has set-gid. Tell us what you are trying to achieve. Show us what you tried, and show us what went wrong. Commented May 4, 2022 at 9:35

2 Answers 2

0

Only root (sudo) and the owner of a file can change the group and permissions of that file:

chgrp usera /opt/test/abcd
chmod g=rwx /opt/test/abcd
0

The group usera already has group rwx permissions. The directory also has setgid privilege, which is why s is shown instead of x or S.

If you really want to remove the setgid bit you can do so,

chmod g-s the_directory

You must log in to answer this question.

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