Help with HDFS Linux permission

Hi,

I am unable to change the permissions for a directory in HDFS.
from what i understand acl's supersede all other permissions. even if a directory is not owned by me, but there is an acl for me with rwx then i must be able to change the permissions of that directory.

Please find the permissions and the error i get when changing.

desind@test:~#> hdfs dfs -ls -d /adhoc/desind
drwxrwx---+  - hdfs supergroup          0 2017-04-17 15:01 /adhoc/desind

desind@test:~#> hdfs dfs -getfacl /adhoc/desind
# file: /adhoc/desind
# owner: hdfs
# group: supergroup
user::rwx
user:desind:rwx
group::---
mask::rwx
other::---

desind@test:~#> hdfs dfs -ls /adhoc/desind
Found 3 items
drwxrwxrwt+  - hdfs   supergroup          0 2017-04-17 14:37 /adhoc/desind/.Trash
-rw-rw----   3 desind supergroup          0 2017-04-17 14:50 /adhoc/desind/test.txt
-rw-rw----   3 desind supergroup          0 2017-04-17 15:01 /adhoc/desind/test1.txt



desind@test:~#> hdfs dfs -chmod 777 /adhoc/desind
chmod: changing permissions of '/adhoc/desind': Permission denied. user=desind is not the owner of inode=desind

I am not familiar with hdfs in particular, but based on standard filesystems you will not be able to change ownership/perms on someone elses file. If you want your desind user to be your filesystem administrator you should set up sudo rules for that user to manipulate the files and directories.

Something in /etc/sudoers like the following that will let the desind user modify permissions on files/directories within the /adhoc filesystem:

User_Alias FILEADMIN = desind
Host_Alias HDFSHOSTS = test
Command_Alias HDFSCOM = hdfs dfs -chmod * /adhoc/*
FILEADMIN HDFSHOSTS=(root) HDFSCOM

Then at the command line you execute

$ sudo hdfs dfs -chmod 777 /adhoc/desind

Note that ideally you would put the full path to the hdfs command in the sudoers command alias, but I don't know what the full path is on your system. You can use the following command to determine the location

which hdfs

777 is not the magic sledgehammer to fix all permissions problems. Should this folder really be world-editable!?

I agree that i cannot change others home directory. But should'nt i be able to change the permissions of my home directory ?

This desind directory in HDFS is my own directory.

/adhoc/desind

You are absolutely right. I was just showing the original poster how to execute the command they were trying to execute without commenting on whether or not they should.

Depends what its ownership and group is, and whether you are either of them.

You definitely don't want to 777 your own home directory...

Not necessarily, depending on the policy of your company / provider / host admin. And, why should you? And, while you own most of the files in it, it might even be that there are, say, configuration files that are locked by the system admin (although not too probable, though).

The user and group i dont belong to. however there is an ACL on that directory which has desind - rwx

so should'nd i be able to change the permissions ? i understand that home directories should not be 777, i am just trying to understand the behavior when i have an ACL.

Here there is an ACL

desind@test:~#> hdfs dfs -getfacl /adhoc/desind
# file: /adhoc/desind
# owner: hdfs
# group: supergroup
user::rwx
user:desind:rwx
group::---
mask::rwx
other::---

That doesn't let you change the permissions, no. 'r' allows you to list the directory, 'w' allows you to create and delete files in it, and 'x' allows you to cd to that folder.