0

There are two linux users

cloudera
omega

Both the above users are under the group batchusers

[omega@node1 projects]$ ls -ltr
drwxrwsr-x+  9 cloudera        batchusers        4096 May  5 10:53  omega_events
[omega@node1 projects]$ cd omega_events
bash: cd: omega_events: Permission denied
[omega@node1 projects]$ cd omega_events
bash: cd: omega_events: Permission denied
[omega@node1 projects]$

I see that omega user is not able to access the folder omega_events

hence I logged in as cloudera user and gave 777 permission to omega user

[cloudera@node1 projects]$ chmod 777 omega_events 
[cloudera@node1 projects]$ ls -ltr
drwxrwsrwx+  9 cloudera        batchusers        4096 May  5 10:53 omega_events

After that I logged in as omega user ,but still i am not able to access the folder omega_events

[omega@node1 projects]$ ls -ltr
drwxrwsrwx+  9 cloudera        batchusers        4096 May  5 10:53   omega_events
[omega@node1 projects]$ cd omega_events
bash: cd: omega_events: Permission denied
[omega@node1 projects]$


[omega@node1 projects]$ id omega
uid=1928292922(omega) gid=1928292922(omega) groups=1928292922(omega),1478288372(cc-manager),1478288372(batchusers),1478221121(emerge),1438902221(data_analytics)


[omega@node1 projects]$ getfacl omega_events
 # file: omega_events
 # owner: cloudera
 # group: batchusers
 user::rwx
 user:omega:rw-
 group::r-x
 group:batchusers:rw-
 mask::rwx
 other::rwx
 default:user::rwx
 default:user:omega:rw-
 default:group::r-x
 default:group:batchusers:rw-
 default:mask::rwx
 default:other::r-x

Could some one help me on this

migrated from stackoverflow.com May 17 '17 at 17:28

This question came from our site for professional and enthusiast programmers.

  • 1
    You have 's' permission for a group instead of 'x' – Michael O. May 5 '17 at 10:14
  • 1
    You also have extended acl set on omega_events. What does getfacl omega_events return? – Dmitri Chubarov May 5 '17 at 10:46
2

Removing the set-group-ID bit

chmod preserves set-group-ID bits unless you explicitly clear them, so chmod 777 omega_events did not help.

You need instead to clear the set-group-ID bit as cloudera and then repeat chmod to give traversal rights (x) to all batchusers.

[cloudera@node1 projects]$ chmod g-s omega_events 
[cloudera@node1 projects]$ chmod 775 omega_events 

After this you should get

[cloudera@node1 projects]$ ls -ltr
drwxrwxr-x+  9 cloudera        batchusers        4096 May  5 10:53 omega_events

Fixing Access Control Lists

Another issue is that you have Access control lists on omega_events. This is indicated by a + sign at the end of the mode line.

The following rules cause permission denied to user omega

user:omega:rw-
group:batchusers:rw-

You can remove them with

[cloudera@node1 projects]$ setfacl -x u:omega omega_events
[cloudera@node1 projects]$ setfacl -x g:batchusers omega_events

You should get

[cloudera@node1 projects]$ getfacl omega_events
 # file: omega_events
 # owner: cloudera
 # group: batchusers
 user::rwx
 group::r-x
 mask::rwx
 other::rwx
 default:user::rwx
 default:user:omega:rw-
 default:group::r-x
 default:group:batchusers:rw-
 default:mask::rwx
 default:other::r-x

Also to remove default ACLs use the following command

[cloudera@node1 projects]$ setfacl -k omega_events
  • Ok. I tried this approach, I usually log in as sudo su - omega Still getting same error after applying the above . but I see that 's' is removed . – user3240790 May 5 '17 at 10:28
  • I updated the question as well – user3240790 May 5 '17 at 10:52
  • The primary group of omega is "omega" – user3240790 May 5 '17 at 10:57

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.