HDFS security
HDFS mimics the Unix-style filesystem permissions mode. Each file and directory has a user, group owner, and set of permissions. These permissions can allow or disallow user access to a given directory or file. For example:
# hdfs dfs -ls / drwxr-xr-x - mapred mapred 0 2013-05-27 04:40 /jobtracker drwxrwxrwt - hdfs supergroup 0 2013-06-08 16:03 /tmp
You can see that the /jobtracker
directory is owned by the user mapred
and only this user is allowed to write files into this directory, while every user can read files in this directory. On the other hand, while the /tmp
directory is owned by the hdfs
user, everyone can read and write files there. This mimics the behavior of the Unix-type /tmp
directory.
Note
Note that there is a sticky bit set on the /tmp
directory as well. This will allow only the file owner to delete and rename files there.
To manipulate files permissions, HDFS provides commands that are similar to those of the Unix environment. As an example, let...