Cloudera: Permission Denied error on hadoop dfs -put

[cloudera@localhost temp]$ su cloudera
[cloudera@localhost temp]$ ls
[cloudera@localhost temp]$ hadoop dfs -put first.csv /
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

put: Permission denied: user=cloudera, access=WRITE, inode="/":hdfs:supergroup:drwxr-xr-x

1 Answer(s)


Hi Mehjabeen
This is a permission issue. Let me explain.
The /user/ directory is owned by "hdfs" - hdfs is a superuser

You are logging in as user cloudera - so you will have permissions only to create or write files in the folder /user/cloudera

So a simple fix to your problem would be to copy the files into the /user/cloudera folder as shown below

hadoop dfs -put first.csv /user/cloudera

You can then do an ls to see if the file is copied

hadoop dfs -ls /user/cloudera

Let me know if this works