Time for action – demonstrating the default security

When we have previously shown listings of files, we have seen user and group names for them. However, we have not really explored what that means. Let's do so.

  1. Create a test text file in the Hadoop user's home directory.
    $ echo "I can read this!" >  security-test.txt 
    $ hadoop fs -put security-test.txt  security-test.txt 
    
  2. Change the permissions on the file to be accessible only by the owner.
    $ hadoop fs -chmod 700 security-test.txt 
    $ hadoop fs -ls
    

    The output of the preceding command can be shown in the following screenshot:

    Time for action – demonstrating the default security
  3. Confirm you can still read the file.
    $ hadoop fs -cat security-test.txt  ...

Get Hadoop: Data Processing and Modelling now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.