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.

Is there a way to prevent a hdfs directory owner to run hadoop rm command?

Solved Go to solution

Is there a way to prevent a hdfs directory owner to run hadoop rm command?

Expert Contributor

Hi All, Is there a way to prevent a hdfs directory owner to run hadoop rm command? Like user1 is the owner of the hdfs directory /app/user1/ and got other folders and files under it. If he runs hadoop fs -rm -R (or just rm) /app/user1 it should fail. Is there a better way to prevent it?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Is there a way to prevent a hdfs directory owner to run hadoop rm command?

Super Guru

@Muthukumar S

Please check - https://community.hortonworks.com/questions/29862/how-to-protect-hdfs-directories-from-deletion-by-m...

There is new feature of protected directories available from hadoop 2.8.0 onwards.

https://issues.apache.org/jira/browse/HDFS-8983

Hope this information helps! :)

2 REPLIES 2

Re: Is there a way to prevent a hdfs directory owner to run hadoop rm command?

Super Guru

@Muthukumar S

Please check - https://community.hortonworks.com/questions/29862/how-to-protect-hdfs-directories-from-deletion-by-m...

There is new feature of protected directories available from hadoop 2.8.0 onwards.

https://issues.apache.org/jira/browse/HDFS-8983

Hope this information helps! :)

Re: Is there a way to prevent a hdfs directory owner to run hadoop rm command?

Expert Contributor
@Kuldeep Kulkarni

Thanks for your comment, we were using hdp 2.4 & hadoop 2.7.2. Not sure this feature is in there with this version.

I enabled read only permission for .Trash folder for the users. Also i was having snapshop enabled for a directory, which is not protective enough as we can able to delete the folders inside a snapshot directory. May be upgrade would be the last option to explore and use it.

Thank you much for the comments.