Reply
Explorer
Posts: 24
Registered: ‎11-15-2016
Accepted Solution

Accessing NFS gateway files and folders as superuser

Hi,

 

I have a host running a NFS gateway mounted on the same machine under /mnt/hdfs.

Permissions seems to work fine for all the regular users, my only issue is the hdfs user. When I access a file using the native hdfs client the hdfs user is considered "the root user" and can perform any operation, is this true even for the file and folders exported via the NFS gateway?

 

In my installation it doesn't work:

 

[hdfs@hostname:/mnt/hdfs/app]$ ls -l
total 3
drwxr-x---. 5 userA nobody 160 19 giu 13:02 appA
drwxr-x---. 5 userB nobody 160 19 giu 13:02 appB
drwxr-x---. 5 userC nobody 160 19 giu 13:02 appC
[hdfs@hostname:/mnt/hdfs/app]$ cd appA
bash: cd: appA: Permission denied

If I try to read from the folder /mnt/hdfs/app/appA as userA it works just fine.

 

Is this the expected or I have misconfigured something?

Highlighted
Explorer
Posts: 24
Registered: ‎11-15-2016

Re: Accessing NFS gateway files and folders as superuser

Apparently this is the expeced behaviour.

 

This JIRA https://issues.apache.org/jira/browse/HDFS-6488 added support for the superuser (backported in CDH 5.8.x) but it is still disabled by default.

 

To set a superuser I've added a safety-valve with the following:

 

<property>
  <name>nfs.superuser</name>
  <value>the_name_of_hdfs_superuser</value>
</property>
Announcements