{"id":14638,"date":"2021-11-04T10:32:23","date_gmt":"2021-11-04T10:32:23","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=14638"},"modified":"2021-11-04T10:32:23","modified_gmt":"2021-11-04T10:32:23","slug":"prevent-users-deleting-certain-files-directadmin","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/","title":{"rendered":"How to Prevent Users from Deleting Certain Files in DirectAdmin?"},"content":{"rendered":"<p>Many clients have no idea about the\u00a0important 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.<\/p>\n<p>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 <em>\/public_html<\/em> file with the FileManager.<\/p>\n<p>1. Prepare a\u00a0script as\u00a0<em>\/usr\/local\/directadmin\/scripts\/custom\/filemanager_pre.sh<\/em>\u00a0and enter the given code in it:<\/p>\n<pre class=\"font-size:15 line-height:20 lang:default decode:true\">#!\/bin\/sh\r\nif [ \"${button}\" = \"delete\" ]; then\r\nif env|grep -m1 -q '=\/public_html$'; then\r\necho \"You cannot delete your public_html link!\"\r\nexit 1\r\nfi\r\nfi\r\nexit 0<\/pre>\n<p>&nbsp;<\/p>\n<p>2. Save the script and make it ready for execution.<\/p>\n<pre class=\"font-size:15 line-height:20 lang:default decode:true\">chmod 755 \/usr\/local\/directadmin\/scripts\/custom\/all_pre.sh\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Try deleting the <em>public_html<\/em> file now. When you do, it will display the error message: &#8220;You cannot delete your public_html link!&#8221;<\/p>\n<p>You can use this method to stop users from deleting other files in DirectAdmin.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many clients have no idea about the\u00a0important 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 [&hellip;]<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1798,41],"tags":[913,1801,2610,2198,1731,2675],"class_list":["post-14638","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-directadmin","category-howtos","tag-delete-a-file","tag-directadmin","tag-directadmin-command","tag-directadmin-panel","tag-linux-hosting","tag-prevent-deleting-files-directadmin"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Prevent Users from Deleting Certain Files in DirectAdmin? - Web Hosting FAQs by MilesWeb<\/title>\n<meta name=\"description\" content=\"This guide is for DirectAdmin admins who want to prevent the users from deleting important files from their hosting servers.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Prevent Users from Deleting Certain Files in DirectAdmin? - Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"og:description\" content=\"This guide is for DirectAdmin admins who want to prevent the users from deleting important files from their hosting servers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-04T10:32:23+00:00\" \/>\n<meta name=\"author\" content=\"Prasad Khartadkar\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasad Khartadkar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/\"},\"author\":{\"name\":\"Prasad Khartadkar\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e\"},\"headline\":\"How to Prevent Users from Deleting Certain Files in DirectAdmin?\",\"datePublished\":\"2021-11-04T10:32:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/\"},\"wordCount\":146,\"commentCount\":0,\"keywords\":[\"delete a file\",\"directadmin\",\"DirectAdmin command\",\"directadmin panel\",\"Linux hosting\",\"prevent deleting files DirectAdmin\"],\"articleSection\":[\"DirectAdmin\",\"How-Tos\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/\",\"name\":\"How to Prevent Users from Deleting Certain Files in DirectAdmin? - Web Hosting FAQs by MilesWeb\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"datePublished\":\"2021-11-04T10:32:23+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e\"},\"description\":\"This guide is for DirectAdmin admins who want to prevent the users from deleting important files from their hosting servers.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Prevent Users from Deleting Certain Files in DirectAdmin?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e\",\"name\":\"Prasad Khartadkar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/08\/Prasad-K.-1-150x150.jpg\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/08\/Prasad-K.-1-150x150.jpg\",\"caption\":\"Prasad Khartadkar\"},\"description\":\"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.\",\"sameAs\":[\"https:\/\/www.milesweb.in\"],\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/prasad-khartadkar\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Prevent Users from Deleting Certain Files in DirectAdmin? - Web Hosting FAQs by MilesWeb","description":"This guide is for DirectAdmin admins who want to prevent the users from deleting important files from their hosting servers.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/","og_locale":"en_US","og_type":"article","og_title":"How to Prevent Users from Deleting Certain Files in DirectAdmin? - Web Hosting FAQs by MilesWeb","og_description":"This guide is for DirectAdmin admins who want to prevent the users from deleting important files from their hosting servers.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2021-11-04T10:32:23+00:00","author":"Prasad Khartadkar","twitter_misc":{"Written by":"Prasad Khartadkar","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/"},"author":{"name":"Prasad Khartadkar","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e"},"headline":"How to Prevent Users from Deleting Certain Files in DirectAdmin?","datePublished":"2021-11-04T10:32:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/"},"wordCount":146,"commentCount":0,"keywords":["delete a file","directadmin","DirectAdmin command","directadmin panel","Linux hosting","prevent deleting files DirectAdmin"],"articleSection":["DirectAdmin","How-Tos"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/","name":"How to Prevent Users from Deleting Certain Files in DirectAdmin? - Web Hosting FAQs by MilesWeb","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"datePublished":"2021-11-04T10:32:23+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e"},"description":"This guide is for DirectAdmin admins who want to prevent the users from deleting important files from their hosting servers.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/prevent-users-deleting-certain-files-directadmin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to Prevent Users from Deleting Certain Files in DirectAdmin?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e","name":"Prasad Khartadkar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/08\/Prasad-K.-1-150x150.jpg","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/08\/Prasad-K.-1-150x150.jpg","caption":"Prasad Khartadkar"},"description":"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.","sameAs":["https:\/\/www.milesweb.in"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/prasad-khartadkar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14638","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=14638"}],"version-history":[{"count":1,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14638\/revisions"}],"predecessor-version":[{"id":14639,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14638\/revisions\/14639"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=14638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=14638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=14638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}