Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution

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

New Contributor

I tried to create a folder using the admin user, at the time of creating it I get the following error: Permission denied: user = admin, access = WRITE, inode = "/ user": hdfs: hdfs: drwxr-xr-x When checking the permissions in Ambari> Users> admin, it tells me that I have all the permissions activated. How can i solve this problem?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Permission denied: user=admin, access=WRITE, inode="/user":hdfs:hdfs:drwxr-xr-x

Expert Contributor

Hi @Karan1211,

User 'admin' does not have access to create a directory under /user. Because the /user/ directory is owned by "hdfs" with 755 permissions. As a result, only hdfs can write to that directory. So you would need to do this:

If you want to create a home directory for root so you can store files in this directory, do:

 

sudo -u hdfs hdfs dfs -mkdir /user/admin
sudo -u hdfs hdfs dfs -chown admin /user/admin

Then as admin you can do hdfs dfs -put file /user/admin/

NOTE: If you get below authentication error, either from your user account, you do not have enough permission to run the above command, so try with sudo or try with first sudo to hdfs user and then execute chown command as hdfs user. 

su: authentication failure

I hope this helps.

View solution in original post

3 REPLIES 3
Highlighted

Re: Permission denied: user=admin, access=WRITE, inode="/user":hdfs:hdfs:drwxr-xr-x

Expert Contributor
@Angel Ajcabul

Using SH or shell-in-a-box (http://sandbox-hdp.hortonworks.com:4200), issue the following commands:

su - hdfs -c "hdfs dfs -mkdir /user/newFolder"
su - hdfs -c "hdfs dfs -chown admin:hdfs /user/newFolder"
Highlighted

Re: Permission denied: user=admin, access=WRITE, inode="/user":hdfs:hdfs:drwxr-xr-x

New Contributor

when I try 'chown' command, it shows: authentication failure

 

can you please help me through it.

 

Highlighted

Re: Permission denied: user=admin, access=WRITE, inode="/user":hdfs:hdfs:drwxr-xr-x

Expert Contributor

Hi @Karan1211,

User 'admin' does not have access to create a directory under /user. Because the /user/ directory is owned by "hdfs" with 755 permissions. As a result, only hdfs can write to that directory. So you would need to do this:

If you want to create a home directory for root so you can store files in this directory, do:

 

sudo -u hdfs hdfs dfs -mkdir /user/admin
sudo -u hdfs hdfs dfs -chown admin /user/admin

Then as admin you can do hdfs dfs -put file /user/admin/

NOTE: If you get below authentication error, either from your user account, you do not have enough permission to run the above command, so try with sudo or try with first sudo to hdfs user and then execute chown command as hdfs user. 

su: authentication failure

I hope this helps.

View solution in original post

Don't have an account?
Coming from Hortonworks? Activate your account here