Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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.