HDFS access denied error

Hi , I am trying to create a directory in hdfs and getting the below error
[cloudera@localhost wordcount]$ hadoop fs -mkdir /wordcount
mkdir: Permission denied: user=cloudera, access=WRITE, inode="/":hdfs:supergroup:drwxr-xr-x

Any help is appreciated.

3 Answer(s)


use command with sudo option
sudo -u hdfs hadoop fs -mkdir /wordcount


Did you trying changing the permissions of the folder via chmod?
give chmod 777


hi Sugandha and Others,

Do not start using the "chmod 777" without understanding the error here. In genera,l, using "chmod 777" is dangerous :)

The problem is with your command that you are executing. You are trying the create "wordcount" under root ("/"). That is the whole problem

The proper command is this
hadoop fs -mkdir /user/cloudera/wordcount (/user/cloudera/ is the hdfs location)