Avoiding deletion of skeleton files

petaglx

Member
Aug 3, 2011
16
0
51
Hello Experts,

Is it possible to configure cpanel somehow to prevent users from deleting vital files and folderd on their host?
 

NetMantis

BANNED
Apr 22, 2012
116
1
66
Utah
cPanel Access Level
DataCenter Provider
I take it you've run into that unfortunately not so rare but infectious creature that is called a "stupid user"? :)

(IE: those who have a troubling habit of deleting everything but the files they should be messing with!)

Unfortunately no --- not really any particularly easy way of doing what you ask.

You could "chattr +i" certain files but if you made a habit of doing that across accounts, that could be very messy, hard to track, and in the case of some files and folders especially with system areas like mail, you'd actually break the accounts doing that so the use of "chattr +i" would really be limited and generally not recommended.

Unfortunately, the very best solution and only real practical viable solution is keep good backups. Make sure your server is configured to keep decent daily, weekly, and monthly backups and preferably an extra backup on a remote location. That way if a user's brain falls out suddenly and goes "splat" all over the keyboard as so often that seems to happen ( :) ), you'll at least be able to quickly repair the account without having to do a whole lot of manual work.

If the user loses up to 24 hours to the last most recent backup, well maybe that'll be a lesson to teach them to be a bit more careful with what they are doing for next time --- at least they wouldn't lose anything longer time than that!
 
Last edited:

Infopro

Well-Known Member
May 20, 2003
17,090
518
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
Hello Experts,

Is it possible to configure cpanel somehow to prevent users from deleting vital files and folderd on their host?
Assuming by your post "vital" you mean error pages, .htaccess, robots.txt, default favicon, the sort of file one might like to add to all new accounts to prevent error logs from filling up with garbage created by these missing default files, what I do is add a txt file as well (with a good title to get them to read it) and try and educate the new user on first login when they see these files, what they are for, how to replace them, and why you should always make sure they are here. They want to be able to use error logs but don't need to see many lines of missing 404 error pages or favicons.

I also explain this to every new account when I send them the account details explaining login via FTP and file management.

When I see them in my logs any more, I just replace them when I see them missing. Sometimes a new user forgets things, breaks things and looks for the delete button and wipes it all, happens. Not that often that its trouble though.

Semi related, there's a Feature Request for having skel files copied to addon and sub domains:
[Case 48382] skeleton directory for addon and sub domains