avast / hdfs-shell

HDFS Shell is a HDFS manipulation tool to work with functions integrated in Hadoop DFS
Apache License 2.0
150 stars 33 forks source link

Switch user inside hdfs-shell.sh and hdfs-shell-daemon.sh #8

Closed XilefNori closed 6 years ago

XilefNori commented 6 years ago

Usually you set user hdfs is working by setting HADOOP_USER_NAME env variable оr switch user with sudo before executing hdfs

HADOOP_USER_NAME="flume" hdfs dfs -text /user/flume/file sudo -E -u flume hdfs dfs -text /user/flume/file

It would be nice if you could switch user inside hdfs-shell session and hdfs-shell-daemon proccess by sending command like 'su {username}' or something like that

Vity01 commented 6 years ago

That won't be easy https://stackoverflow.com/questions/47413109/changing-hadoop-username-during-runtime-doesnt-work At this time I don't know how to implement it. MR are welcome.

Vity01 commented 6 years ago

I think I found a solution for unsecured HDFS. Together with 'su' command I also added support for 'whoami' command.

XilefNori commented 6 years ago

Thank you!!!

Vity01 commented 6 years ago

You are welcome. If you like HDFSShell, please spread a word about it.