Created 06-26-2017 02:15 PM
Hi,
So I log in to Ambari as admin, then I try to add a folder in files view:
Permission denied: user=admin, access=WRITE, inode="/ml-in-a-nutshell":hdfs:hdfs:drwxr-xr-x
I am accessing Ambari via Chrome under another user, 'ed'.
So should I be logging into Ambari as hdfs? Or maybe changing admin permissions?
But if I login as hdfs then will it see my existing cluster and what would be the passowrd?
This user thing is quite confusing.
Created 06-26-2017 02:27 PM
As we see that the write access is there only for the "hdfs" user on the directory "/ml-in-a-nutshell"
So if you want to write in that directory as "ed" user then the "ed" user should have write permission on that mentioned HDFS directory.
Example: So try changing the permission as followong:
# su - hdfs -c "hdfs dfs -chown ed:hadoop /ml-in-a-nutshell
.
Or else you will need to use the "hdfs dfs -chmod" command to allow write access to the "ed" user on the mentioned directory.
.
Similarly if you want the "admin" user to be able to access to write in that directory then you will need to change th permissions of that HDFS directory as mentioned above.
.
Created 06-26-2017 02:27 PM
As we see that the write access is there only for the "hdfs" user on the directory "/ml-in-a-nutshell"
So if you want to write in that directory as "ed" user then the "ed" user should have write permission on that mentioned HDFS directory.
Example: So try changing the permission as followong:
# su - hdfs -c "hdfs dfs -chown ed:hadoop /ml-in-a-nutshell
.
Or else you will need to use the "hdfs dfs -chmod" command to allow write access to the "ed" user on the mentioned directory.
.
Similarly if you want the "admin" user to be able to access to write in that directory then you will need to change th permissions of that HDFS directory as mentioned above.
.
Created 06-27-2017 05:26 AM
Thanks Jay, but I was trying to add the folder, not write into it. I was adding it to the root folder /.
Created 06-27-2017 05:35 AM
The HDFS root directory allows only the hdfs:hdfs (username:groupname) user to write on "/"
Please check the permission to know who can write in the ROOT (/) directory of hdfs file system.
# su - hdfs -c "hdfs dfs -ls -d /" drwxr-xr-x - hdfs hdfs 0 2017-06-21 09:59 /
.
In order to create a directory "Write" permission is needed to the user.
So if you want to create the directory inside "/" then you should create the directory as hdfs user and then you can use chown and chmod commands properly to give read/write/execute access on this directory to your desired users.
.
Created 06-27-2017 05:40 AM
I cretaed the folder under /user/admin for which I have permissions. Makes sense I suppose.
Created 06-27-2017 05:51 AM
Good to see your resolved your query.
However your Exception that is mentioned in the query is different. And your Accepted answer does not really answers query/exception that was asked.
Regarding admin user directory "/user/admin" please refer to the Hortonworks Documentation, Which will help other users to know why do we need to create "/user/admin" directory and assign permission to it as "admin:hadoop"
Created 06-27-2017 01:06 PM
Yes fair enough. Your answer now accepted, thanks for your help.