Support Questions
Find answers, ask questions, and share your expertise

Need help on user and its access in HDFS for HDP2.5.0.

Rising Star

Need help on user and its access in HDFS.

In HDP2.5 , while working on HDFS authorization with Apache Ranger, I found , am unable to change file permission as a root user. Can someone please help what would be the user and its default access credentials.

[root@sandbox ~]# hdfs dfs -ls /user

Found 16 items

drwxr-xr-x - admin hdfs 0 2017-01-11 08:28 /user/admin

drwxrwx--- - ambari-qa hdfs 0 2016-10-25 07:47 /user/ambari-qa

drwxr-xr-x - amy_ds hdfs 0 2016-10-25 08:02 /user/amy_ds

drwxr-xr-x - hbase hdfs 0 2016-10-25 07:48 /user/hbase

drwxr-xr-x - hcat hdfs 0 2016-10-25 07:51 /user/hcat

drwxr-xr-x - hive hdfs 0 2017-01-19 13:25 /user/hive

drwxr-xr-x - holger_gov hdfs 0 2016-10-25 08:03 /user/holger_gov

drwxrwxr-x - livy hdfs 0 2016-10-25 07:49 /user/livy

drwxr-xr-x - maria_dev hdfs 0 2017-01-05 14:35 /user/maria_dev

drwxrwxr-x - oozie hdfs 0 2016-10-25 07:52 /user/oozie

drwxr-xr-x - raj_ops hdfs 0 2017-01-11 08:29 /user/raj_ops

drwx------ - root hdfs 0 2017-01-19 10:34 /user/root

drwxrwxr-x - spark hdfs 0 2016-10-25 07:48 /user/spark

drwxr-xr-x - vz_all hdfs 0 2017-01-12 10:58 /user/vz_all

drwxr-xr-x - vz_vdsi hdfs 0 2017-01-19 14:18 /user/vz_vdsi

drwxr-xr-x - zeppelin hdfs 0 2016-10-25 07:50 /user/zeppelin

[root@sandbox ~]# hdfs dfs -chmod -R 700 /user/hive 17/01/31 12:11:18 WARN retry.RetryInvocationHandler: Exception while invoking ClientNamenodeProtocolTranslatorPB.setPermission over null. Not retrying because try once and fail. org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied. user=root is not the owner of inode=hive

at org.apache.hadoop.fs.FsShell.main(FsShell.java:350) chmod: changing permissions of '/user/hive': Permission denied. user=root is not the owner of inode=hive [root@sandbox ~]# exit

am trying to follow instructions mentioned in below URL.

http://hortonworks.com/blog/best-practices-in-hdfs-authorization-with-apache-ranger/

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Need help on user and its access in HDFS for HDP2.5.0.

Contributor

@Dinesh Das Try running the chmod command as user 'hdfs':

su - hdfs -c 'hdfs dfs -chmod -R 700 /user/hive'

In HDFS, 'root' doesn't have any special access but the user 'hdfs' is considered a super-user so can read/write any file.

View solution in original post

2 REPLIES 2

Re: Need help on user and its access in HDFS for HDP2.5.0.

Contributor

@Dinesh Das Try running the chmod command as user 'hdfs':

su - hdfs -c 'hdfs dfs -chmod -R 700 /user/hive'

In HDFS, 'root' doesn't have any special access but the user 'hdfs' is considered a super-user so can read/write any file.

View solution in original post

Re: Need help on user and its access in HDFS for HDP2.5.0.

Rising Star

Thank you Sir, much appreciated 🙂