Reputation: 666
I have a standalone cluster for practice purpose. I tried to add the root user to hdfs group by logging in as an HDFS user.
The command I used is:
hdfs dfs -chown -R root:hdfs /
Now, I am able to access hdfs dfs commands as a root. But I don't know how to delete root from HDFS group. I tried this command as hdfs user:
hdfs dfs -chown -R hdfs:hdfs /
and
groups
command as a root user. But root is not added to any other group except for it's Primary group.
How am I supposed to change it back to the way it was?
Upvotes: 1
Views: 5614
Reputation: 2328
By doing hdfs dfs -chown -R <user>:<group>
you are not adding any user to any group.
Rather you are changing the directory/file permissions recursively from the /
directory.
I think you can try hdfs dfs -chown -R hdfs:hdfs /
logged in as hdfs
. Then it should go back to previous state.
Upvotes: 3
Reputation: 191738
Groups and users don't physically "exist" in HDFS. They only exist on the local operating system. (Assuming you're not using Kerberos + LDAP).
You didn't add anything. You just changed a metadata tag ownership of an HDFS file path. And if you have ACLs and permissions disabled anyway as part of the default properties, these aren't checked.
The namenode(s) are where you would establish user groups using appropriate groupadd
and useradd
commands on the OS, but the root user is part of all *nix groups, so I'm not sure why you'd want to delete it rather than just prevent access.
Upvotes: 0