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/filemanager_pre.sh and enter the given code in it:
#!/bin/sh if [ "${button}" = "delete" ]; then if env|grep -m1 -q '=/public_html$'; then echo "You cannot delete your public_html link!" exit 1 fi fi exit 0
2. Save the script and make it ready for execution.
chmod 755 /usr/local/directadmin/scripts/custom/all_pre.sh
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.