Getting this problem while creating a directory in hadoop file system mkdir: Permission denied: user=ubuntu, access=WRITE, inode="/user/ubuntu":hdfs:supergroup:drwxr-xr-x
This can be achieved in two ways :-
1) Run the command using hdfs user
sudo -u hdfs hdfs dfs -mkdir /user/ubuntu/
2) Change the ownership of the folders using the hdfs user so that you may not face problems while creating directories inside it or using it.
sudo -u hdfs hdfs dfs -chowm ubuntu:ubuntu /user/ubuntu/
Now user ubuntu will take the ownership of the ubuntu directory in Hadoop file system.