0
votes

I am new to hadoop and I have a problem.

The problem is I want give someone to use hdfs command, but cannot give them root password, So everything that needed "sudo" or "su hdfs" could not work. I have the reason that i cannot give others root permission.

I have found some solution like:

Create a group, change and let the group have HDFS permission, and add a user in, so that user would have HDFS permission. I had try it but fail.

So, I want to let a user be able to use hdfs commands without using "sudo -su hdfs" command or any command needed sudo permission. Could you tell me how to set the related settings or files with deeper details or any useful reference website ? Thank you all!

2
hdfs command does not need sudo. You should execute hdfs commands as hadoop user and not as root user.Rajesh N

2 Answers

0
votes

I believe by just setting the permission of /usr/bin/hdfs to be '-rwxr-xr-x 1 root root' ,other accounts should be able to execute the command hdfs successfully. have you tried it?

0
votes

Rajest is right, 'hdfs command does not need sudo', probably you are using 'sudo -su hdfs' because command is attacking to path where only user 'hdfs' has permissions, you must organize data for your users.

A workarround (if you are not using kerberos) for using hdfs with any user is executing this line before working:

  export HADOOP_USER_NAME=<HDFS_USER>