Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hadoop user file permissions

i have a problem in setting hadoop file permissions in hortonworks and cloudera.

My requirement is:

1. create a new user with new group  
2. create user directory in hdfs ( ex. /user/myuser )  
3. Now this folder ( in this case /user/myuser ) must be accessible to only user and its group but not other users and other groups. 

Following commands are used by me. ( in centos 6)

1.create group >>> groupadd mygroup
2. create new user who belongs to new group >>>> useradd -g mygroup myuser
3. create user directory in hdfs >>> hadoop fs -mkdir /user/myuser
4. changing ownership of the folder >>> hadoop fs -chown -R myuser:mygroup /user/myuser
5. giving permissions to user folder >>> hadoop fs -chmod -R 700 /user/myuser
6. i also changed the /tmp file permission to sticky bit. >>> hadoop fs -chmod -R 1777 /tmp

Here the problem comes, even setting this permissions the other users in other groups are accessing my data. please tell me the solution for this. I turned on hdfs file permissions by setting ( dfs.permission.enabled=true ).

like image 693
kiran Avatar asked Nov 08 '22 18:11

kiran


1 Answers

I believe you set the wrong property to enable permissions. You need to set the following property in hdfs-site:

dfs.permissions.enabled = true

This is a good resource for HDFS permissions

like image 64
cjackson Avatar answered Nov 15 '22 09:11

cjackson