I think prevent home folder from deleting is a very good idea. So I search possible approaches to do that. I that's what Im find:Use chattr +i /home/user - even root can't can add/delete/rename user folder and all direct children in user - good and bad.Change owner of user directory to root and set sticky bit. Add file .keep and change his owner to root too: chown root:user /home/userchmod 1775 /home/userchown root /home/user/.keep root can delete /home/user, user can't. But user can freely add/remove/rename files in his directoryUse chattr +a /home/user - same as first approach but user can add files.I think chattr +a on home directory: chattr +a /home is the best way:We can create new home folders for other users without pain.We can freely edit files in /home/userWe can't accidentally sudo rm -rf /home/user Actually the question: what are the pitfalls of this approach?
Approaches to prevent user from deleting home folder
home;xattr