Knowledge Base
MilesWeb / DirectAdmin, How-Tos

How to Prevent Users from Deleting Certain Files in DirectAdmin?

Approx. read time : 2 min

Many clients have no idea about the important files and delete them mistakenly. There is a way to prevent the users from deleting these files with DirectAdmin. For that, you will need admin and SSH access.

By limiting their choices and ability to delete the vital files, we can indirectly emphasize their importance. For example, we will block the users from deleting the /public_html file with the FileManager.

1. Prepare a script as /usr/local/directadmin/scripts/custom/ and enter the given code in it:


2. Save the script and make it ready for execution.


Try deleting the public_html file now. When you do, it will display the error message: “You cannot delete your public_html link!”

You can use this method to stop users from deleting other files in DirectAdmin.

Prasad Khartadkar
Prasad is a business grad specialized in Marketing. He has garnered experience as a technical content writer and a digital marketer that he brings out in his work. He likes reading classics and travel in his free time.