Support Questions

Find answers, ask questions, and share your expertise

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

avatar
Rising Star

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

avatar
Master 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! 🙂

View solution in original post

2 REPLIES 2

avatar
Master 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! 🙂

avatar
Rising Star
@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.